private async void EditCamera_Click(object sender, RoutedEventArgs e) { var capture = new CameraCaptureUI(); capture.PhotoSettings.AllowCropping = false; capture.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg; capture.PhotoSettings.MaxResolution = CameraCaptureUIMaxPhotoResolution.MediumXga; var file = await capture.CaptureFileAsync(CameraCaptureUIMode.Photo); if (file != null) { var dialog = new EditYourPhotoView(file) { CroppingProportions = ImageCroppingProportions.Square, IsCropEnabled = false }; var dialogResult = await dialog.ShowAsync(); if (dialogResult == ContentDialogBaseResult.OK) { ViewModel.EditPhotoCommand.Execute(dialog.Result); } } }
public async void EditPhoto_Click(object sender, RoutedEventArgs e) { var picker = new FileOpenPicker(); picker.ViewMode = PickerViewMode.Thumbnail; picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; picker.FileTypeFilter.AddRange(Constants.PhotoTypes); var file = await picker.PickSingleFileAsync(); if (file != null) { var dialog = new EditYourPhotoView(file) { CroppingProportions = ImageCroppingProportions.Square, IsCropEnabled = false }; var dialogResult = await dialog.ShowAsync(); if (dialogResult == ContentDialogBaseResult.OK) { ViewModel.EditPhotoCommand.Execute(dialog.Result); } } }