Beispiel #1
0
        public static async Task ShowAsync(PhotoSelectorOptions options, Action <PicSelectionResult> onCompletionHandler)
        {
            var page = new ContentPage();
            var vm   = new PicSelectorViewModel(page, options);
            await vm.InitializeAsync();

            page.Content = new PicSelectorView(vm);
            await Application.Current.MainPage.Navigation.PushModalAsync(page);

            // after the page is done, go ahead and run the 'onCompleteHandler' to store the user-selected image
            page.Disappearing += (sender, args) => onCompletionHandler(vm.CropViewModel.PicSelectionResult);
        }
Beispiel #2
0
 public PicSelectorView(PicSelectorViewModel viewModel)
 {
     BindingContext = viewModel;
     InitializeComponent();
     SizeChanged += (sender, args) => viewModel.CropViewModel.Resized(Width, Height);
 }