//METHODS public override void ViewDidLoad() { base.ViewDidLoad(); this.NavigationItem.SetRightBarButtonItem( new UIBarButtonItem(UIBarButtonSystemItem.Add, (sender, args) => { // button was clicked //Create Alert var textInputAlertController = UIAlertController.Create("Add Note", null, UIAlertControllerStyle.Alert); //Add Text Input textInputAlertController.AddTextField(textField => { }); //Add Actions var cancelAction = UIAlertAction.Create("Cancel", UIAlertActionStyle.Default, alertAction => Console.WriteLine("Cancel was Pressed")); var okayAction = UIAlertAction.Create("Add", UIAlertActionStyle.Cancel, alertAction => { AllNotes_IndividualNote note = new AllNotes_IndividualNote(textInputAlertController.TextFields[0].Text.ToString()); AllIdeasPageTVC.allNotes.AddNoteToList(note); TableView.ReloadData(); }); textInputAlertController.AddAction(cancelAction); textInputAlertController.AddAction(okayAction); //Present Alert PresentViewController(textInputAlertController, true, null); }) , true); }
//Allows us to get access to a section from the IndivdualSongLyricPageTVC. We store the reference in a local variable. public void SetNote(AllNotes_IndividualNote selectedNote) { this.selectedNote = selectedNote; }
//METHODS public void AddNoteToList(AllNotes_IndividualNote note) { allNotes.Add(note); }