private void btnCamera_Clicked(object sender, EventArgs e) { ICamera capturar = DependencyService.Get <ICamera>(); capturar.CapturarFoto(); MessagingCenter.Subscribe <ICamera, string>(this, "cameraFoto", (objeto, image) => { this.imgFoto.Source = ImageSource.FromFile(image); }); }
private async void TapGestureRecognizer_Tapped(object sender, EventArgs e) { if (await DisplayAlert("Trocar imagem", "Deseja alterar a foto?", "Sim", "Nao")) { ICamera capturar = DependencyService.Get <ICamera>(); capturar.CapturarFoto(); MessagingCenter.Subscribe <ICamera, string>(this, "cameraFoto", (objeto, image) => { this.imgFoto.Source = ImageSource.FromFile(image); }); } }