Exemple #1
0
        private async void TakePictureFromLibrary()
        {
            try
            {
                UserProfileImagePath = await mediaPickerService.TakePictureFromLibrary();

                UserInfoModel.UserProfileImage = UserProfileImagePath;
            }
            catch (NotSupportedException)
            {
                await NavigationService.DisplayAlert("Error", "Not supported on this device.", "Ok");
            }
            catch (System.Exception ex)
            {
                await NavigationService.DisplayAlert("Error", "Unable to take a photo.", "Ok");
            }
        }
Exemple #2
0
 private async void TakePictureFromLibrary()
 {
     try
     {
         UserModel.Photo = await mediaPickerService.TakePictureFromLibrary();
     }
     catch (NotSupportedException e)
     {
         await NavigationService.DisplayAlert("Error", "Not supported on this device.", "Ok");
     }
     catch (ArgumentException ae)
     {
         //skip for this case
     }
     catch (Exception ex)
     {
         await NavigationService.DisplayAlert("Error", "Unable to take a photo.", "Ok");
     }
 }