示例#1
0
        async void doCameraPhoto(PhotoListData pld)
        {
#if __ANDROID__
            MediaPicker picker = new MediaPicker(Forms.Context);
#else
            MediaPicker picker = new MediaPicker();
#endif

            if (picker.IsCameraAvailable == false)
            {
                var page   = new ContentPage();
                var result = page.DisplayAlert("Warning", "Camera is not available", "OK");

                return;
            }
            else
            {
                try
                {
                    var resultfile = await picker.TakePhoto(null);

#if __ANDROID__
                    showDrawingView(pld);
#else
                    showDrawingView(pld);
#endif
                }
                catch (Exception ex)
                {
                }
            }
        }
示例#2
0
        private async Task TakePhoto()
        {
            MediaFile photo = await MediaPicker.TakePhoto();

            _ticket.AddAtachment(photo);
        }