private async void OnTirarFoto() { if (IsBusy) { return; } IsBusy = true; try { var arquivo = await PickMedia.GetPhotoFromCamera(); if (arquivo != null) { AnexoUrl = arquivo.Path; anexoStream = arquivo.GetStream(); } } catch (Exception ex) { await Application.Current.MainPage.DisplayAlert("Erro", ex.Message, "Ok"); } finally { IsBusy = false; } }
private async void OnGaleria() { if (IsBusy) { return; } IsBusy = true; try { var arquivo = await PickMedia.GetPhotoFromGallery(); if (arquivo != null) { ImgLogoEmpresa = arquivo.Path; imgLogoEmpresaStream = arquivo.GetStream(); } } catch (Exception ex) { await Application.Current.MainPage.DisplayAlert("Erro", ex.Message, "Ok"); } finally { IsBusy = false; } }