Created
June 15, 2017 02:03
-
-
Save Char0394/aa728510b391c6742a6dc17a4a48b5f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class MainPage : ContentPage | |
{ | |
List<string> _images = new List<string>(); | |
public MainPage() | |
{ | |
InitializeComponent(); | |
//Remember to remove the temporal files | |
//DependencyService.Get<IMediaService>().ClearFiles(_images); | |
} | |
protected override void OnAppearing() | |
{ | |
base.OnAppearing(); | |
MessagingCenter.Subscribe<App, List<string>> ((App)Xamarin.Forms.Application.Current, "ImagesSelected", (s, images) => | |
{ | |
listItems.FlowItemsSource = images; | |
_images = images; | |
}); | |
} | |
protected override void OnDisappearing() | |
{ | |
base.OnDisappearing(); | |
MessagingCenter.Unsubscribe<App, List<string>>(this, "ImagesSelected"); | |
} | |
async void Handle_Clicked(object sender, System.EventArgs e) | |
{ | |
await DependencyService.Get<IMediaService>().OpenGallery(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment