public override void ViewDidLoad() { base.ViewDidLoad(); Title = "Add Note"; NoteTitle.ShouldReturn = (textField) => { NoteContents.BecomeFirstResponder(); return(true); }; NoteContents.ShouldReturn = (textField) => { textField.ResignFirstResponder(); return(true); }; SaveNote.TouchUpInside += delegate { AppDelegate.NoteRepository.Add( NoteTitle.Text, NoteContents.Text); NavigationController.PopViewController(true); }; }
public override void ViewDidLoad() { base.ViewDidLoad(); Title = "Note"; NoteTitle.Text = _note.Title; NoteContents.Text = _note.Contents; NoteContents.SizeToFit(); var deleteButton = new UIBarButtonItem(UIBarButtonSystemItem.Trash, delegate { AppDelegate.NoteRepository.Delete(_note.Id); NavigationController.PopViewController(true); }); NavigationItem.RightBarButtonItem = deleteButton; }