Ejemplo n.º 1
0
		async void doPhotoLibrary(PhotoListData pld)
		{
			#if __ANDROID__
			MediaPicker picker = new MediaPicker(Forms.Context);
			#else
			MediaPicker picker = new MediaPicker();
			#endif

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

				return;
			}
			else
			{
				try
				{
					var resultfile = await picker.PickPhoto();
					#if __ANDROID__
					//showDrawingView(pld);
					#else
					//showDrawingView(pld);
					#endif
				}
				catch (Exception e)
				{
				}
			}
		}
Ejemplo n.º 2
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)
				{
				}
			}
		}
Ejemplo n.º 3
0
		async void showDrawingView(PhotoListData pld)
		{
			/*var pv = new DrawingPhotoView();
			pv.PhotoList = pld;
			await Navigation.PushAsync(pv);
			pld = pv.PhotoList;*/
		}
Ejemplo n.º 4
0
		async private Task doPhotoAction(PhotoListData pld)
		{
#if __ANDROID__
			var action = await DisplayActionSheet("Select Source","Cancel",null,"Camera","Photo Library");
			if (action == "Camera")
			{
				doCameraPhoto(pld);
			}
			else if (action == "Photo Library")
			{
				doPhotoLibrary(pld);
			}
#else

			var action = await DisplayActionSheet("Select Source", "Cancel", null, "Camera", "Photo Library");
			if (action == "Camera")
			{
			doCameraPhoto(pld);
			}
			else if (action == "Photo Library")
			{
			doPhotoLibrary(pld);
			}
			//doPhotoLibrary(pld);
#endif
		}