I just used NUGET and installed Xam.Plugin.Media so that I can take photos using my mobile app.
I wrote the following code in the click event of the button as per the sample code in the xamarin component website:
private async void btnTake1_Clicked(object sender, EventArgs e) { if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported) { await DisplayAlert("No Camera", ":( No camera avaialble.", "OK"); return; } var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions { Directory = "Sample", Name = "test.jpg" }); if (file == null) return; await DisplayAlert("File Location", file.Path, "OK"); imgPhoto1.Source = ImageSource.FromStream(() => { var stream = file.GetStream(); file.Dispose(); return stream; }); } All went well and the Solution is building successfully, I am running only UWP now. But when I click the button it breaks at some location in
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break(); Can somebody help me with this? Thanks in advance. Sarin Gopalan