cjlotz / Xamarin.Plugins

Cross platform Xamarin Plugins
MIT License
113 stars 56 forks source link

[WP8.1 / UWP] Make WithAttachment a little more PCL-friendly #45

Closed pingzing closed 7 years ago

pingzing commented 8 years ago

This is a little rough, but I thought I'd send it in as something of a proposal--currently there's no way to use .WithAttachment from a PCL in a way that'll work on Windows platforms, which can be kind of limiting.

This PR would allow access to files that the application has permission to access without any special privileges (i.e. anything contained in ApplicationData). So it won't play nicely with StorageFiles obtained via some kind of file picker, but it'll be fine for things saved in the app's local storage.

I'm also reasonably sure that I've handled the async call in a way that should prevent any deadlocking, but I'd love more eyes on that part.

cjlotz commented 7 years ago

I'm implementing a variant of your code in an upcoming release. Thanks for the suggestion.