예제 #1
0
        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;
            }
        }
예제 #2
0
        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;
            }
        }