void Unsibscribe(UIDocumentMenuViewController menu)
		{
			menu.WasCancelled -= OnPickerSelectionCancel;
			menu.DidPickDocumentPicker -= OnPickerPicked;
		}
		/// <summary>
		/// Views the did load.
		/// </summary>
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Save the default text area height
			_documentTextHeight = DocumentText.Frame.Height;

			// var picker = new UIDocumentPickerViewController (srcURL, UIDocumentPickerMode.ExportToService);

			// Watch for a new document being created
			ThisApp.DocumentLoaded += (document) => {
				// Display the contents of the document
				DocumentText.Text = document.Contents;

				// Watch for the document being modified by an outside source
				document.DocumentModified += (doc) => {
					// Display the updated contents of the document
					DocumentText.Text = doc.Contents;
					Console.WriteLine("Document contents have been updated");
				};
			};

			// Wireup events for the text editor
			DocumentText.ShouldBeginEditing= delegate(UITextView field){
				//Placeholder
				MoveDocumentText(_documentTextHeight-170f);
				return true;
			};
			DocumentText.ShouldEndEditing= delegate (UITextView field){
				MoveDocumentText(_documentTextHeight);
				ThisApp.Document.Contents = DocumentText.Text;
				return true;
			};

			// Wireup the Save button
			SaveButton.Clicked += (sender, e) => {
				// Close the keyboard
				DocumentText.ResignFirstResponder();

				// Save the changes to the document
				ThisApp.SaveDocument();
			};

			// Wireup the Action buttom
			ActionButton.Clicked += (s, e) => {

				// Allow the Document picker to select a range of document types
				var allowedUTIs = new string[] {
					UTType.UTF8PlainText,
					UTType.PlainText,
					UTType.RTF,
					UTType.PNG,
					UTType.Text,
					UTType.PDF,
					UTType.Image
				};

				// Display the picker
				//var picker = new UIDocumentPickerViewController (allowedUTIs, UIDocumentPickerMode.Open);
				var pickerMenu = new UIDocumentMenuViewController(allowedUTIs, UIDocumentPickerMode.Open);
				pickerMenu.DidPickDocumentPicker += (sender, args) => {

					// Wireup Document Picker
					args.DocumentPicker.DidPickDocument += (sndr, pArgs) => {

						// IMPORTANT! You must lock the security scope before you can
						// access this file
						var securityEnabled = pArgs.Url.StartAccessingSecurityScopedResource();

						// Open the document
						ThisApp.OpenDocument(pArgs.Url);

						// TODO: This should work but doesn't
						// Apple's WWDC 2014 sample project does this but it blows
						// up in Xamarin
						 NSFileCoordinator fileCoordinator = new NSFileCoordinator();
						 NSError err;
						 fileCoordinator.CoordinateRead (pArgs.Url, 0, out err, (NSUrl newUrl) => {
							NSData data = NSData.FromUrl(newUrl);
							Console.WriteLine("Data: {0}",data);
						 });

						// IMPORTANT! You must release the security lock established
						// above.
						pArgs.Url.StopAccessingSecurityScopedResource();
					};

					// Display the document picker
					PresentViewController(args.DocumentPicker,true,null);
				};

				pickerMenu.ModalPresentationStyle = UIModalPresentationStyle.Popover;
				PresentViewController(pickerMenu,true,null);
				UIPopoverPresentationController presentationPopover = pickerMenu.PopoverPresentationController;
				if (presentationPopover!=null) {
					presentationPopover.SourceView = this.View;
					presentationPopover.PermittedArrowDirections = UIPopoverArrowDirection.Down;
					presentationPopover.SourceRect = ((UIButton)s).Frame;
				}
			};

		}
		void SetupDelegateThenPresent(UIDocumentMenuViewController vc, UIButton button)
		{
			vc.WasCancelled += OnPickerSelectionCancel;
			vc.DidPickDocumentPicker += OnPickerPicked;

			vc.AddOption ("Custom Option", null, UIDocumentMenuOrder.First, () => {
				Console.WriteLine ("completionHandler Hit");
			});

			vc.ModalPresentationStyle = UIModalPresentationStyle.Popover;
			PresentViewController (vc, true, null);

			UIPopoverPresentationController presentationPopover = vc.PopoverPresentationController;
			if (presentationPopover != null) {
				presentationPopover.SourceView = View;
				presentationPopover.PermittedArrowDirections = UIPopoverArrowDirection.Down;
				presentationPopover.SourceRect = button.Frame;
			}
		}
		public void MoveToDocMenu(UIButton sender)
		{
			if (TryShowFileNotExistsError ())
				return;

			UIDocumentMenuViewController vc = new UIDocumentMenuViewController (documentURL, UIDocumentPickerMode.MoveToService);
			SetupDelegateThenPresent (vc, sender);
		}
		public void OpenDocMenu(UIButton sender)
		{
			UIDocumentMenuViewController vc = new UIDocumentMenuViewController (allowedUTIs, UIDocumentPickerMode.Open);
			SetupDelegateThenPresent (vc, sender);
		}
		public void MoveToDocMenu(UIButton sender)
		{
			UIDocumentMenuViewController vc = new UIDocumentMenuViewController (documentURL, UIDocumentPickerMode.MoveToService);
			SetupDelegateThenPresent (vc, sender);
		}
        public void WasCancelled(UIDocumentMenuViewController documentMenu)
        {
            var tcs = Interlocked.Exchange(ref _completionSource, null);

            tcs?.SetResult(null);
        }