private void AddNote() { TextInputDialog dialog = new TextInputDialog(); dialog.Submitted += (s, e) => ValidateTitle(e); if (dialog.ShowDialog(this) == true) { Note note = new Note(dialog.Text); NotesManager.AddNote(note); notesTabControl.SelectedItem = note; } }
private void RenameCurrentNote() { if (SelectedNote == null) { return; } TextInputDialog dialog = new TextInputDialog(SelectedNote.Name); dialog.Submitted += (s, e) => ValidateTitle(e); if (dialog.ShowDialog(this) == true) { SelectedNote.Name = dialog.Text; } }