public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            NavigationItem.LargeTitleDisplayMode = UINavigationItemLargeTitleDisplayMode.Never;

            SaveButton.TouchUpInside += (sender, e) => {
                current.Name  = NameText.Text;
                current.Notes = NotesText.Text;
                current.Done  = DoneSwitch.On;
                current.For   = ForText.Text;

                // includes CoreSpotlight indexing!
                Delegate.SaveTodo(current);

                UIAccessibility.PostNotification(UIAccessibilityPostNotification.Announcement, new NSString(@"Item was saved"));

                NavigationController.PopViewController(true);
            };
            CancelButton.TouchUpInside += (sender, e) => {
                if (Delegate != null)
                {
                    Delegate.DeleteTodo(current);                     // also CoreSpotlight

                    UIAccessibility.PostNotification(UIAccessibilityPostNotification.Announcement, new NSString(@"Item was deleted"));
                }
                else                  // HACK: TODO:
                {
                    Console.WriteLine("Delegate not set - HACK");
                }

                NavigationController.PopViewController(true);
            };

            #region iOS 9 Contacts
            contacts = new ContactHelper(current);
            UITapGestureRecognizer forTextTap = new UITapGestureRecognizer(() => {
                PresentViewController(contacts.GetPicker(), true, null);
            });
            ForText.AddGestureRecognizer(forTextTap);
            ForText.UserInteractionEnabled = true;
            #endregion

            NameText.TextAlignment  = UITextAlignment.Natural;
            NotesText.TextAlignment = UITextAlignment.Natural;

            UserActivity = UserActivityHelper.CreateNSUserActivity(current ?? new TodoItem());
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // DEMO: the second item in the stack disables large titles
            NavigationItem.LargeTitleDisplayMode = UINavigationItemLargeTitleDisplayMode.Never;

            SaveButton.TouchUpInside += (sender, e) => {
                Current.Name  = NameText.Text;
                Current.Notes = NotesText.Text;
                Current.Done  = DoneSwitch.On;

                // includes CoreSpotlight indexing!
                Delegate.SaveTodo(Current);

                UIAccessibility.PostNotification(UIAccessibilityPostNotification.Announcement, new NSString(@"Item was saved"));

                NavigationController.PopViewController(true);
            };
            CancelButton.TouchUpInside += (sender, e) => {
                if (Delegate != null)
                {
                    Delegate.DeleteTodo(Current);                     // also CoreSpotlight

                    UIAccessibility.PostNotification(UIAccessibilityPostNotification.Announcement, new NSString(@"Item was deleted"));
                }
                else
                {
                    Console.WriteLine("Delegate not set - this shouldn't happen");
                }

                NavigationController.PopViewController(true);
            };

            NameText.TextAlignment  = UITextAlignment.Natural;
            NotesText.TextAlignment = UITextAlignment.Natural;

            UserActivity = UserActivityHelper.CreateNSUserActivity(Current ?? new TodoItem());

            // Map button
            PhotoButton = UIButton.FromType(UIButtonType.Custom);
            PhotoButton.SetTitle("Photo", UIControlState.Normal);
            PhotoButton.BackgroundColor = UIColor.Green;

            PhotoButton.SizeToFit();
            PhotoButton.TouchUpInside += (sender, e) => {
                Console.WriteLine("take photo");
                var popover = Storyboard.InstantiateViewController("photo");

                Console.WriteLine("pass todo item");
                (popover as PhotoViewController).Todo = (NavigationController.VisibleViewController as DetailViewController).Current;

                PresentViewController(popover, true, null);

                // Configure the popover for the iPad, the popover displays as a modal view on the iPhone
                UIPopoverPresentationController presentationPopover = popover.PopoverPresentationController;
                if (presentationPopover != null)
                {
                    presentationPopover.SourceView = View;
                    presentationPopover.PermittedArrowDirections = UIPopoverArrowDirection.Up;
                    presentationPopover.SourceRect = View.Frame;
                }
            };
            View.AddSubview(PhotoButton);
        }