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); }