// Handles the behaviour for clicking the Add Note button private void Add_Note_Button_Click(object sender, RoutedEventArgs e) { uint noteCount = (uint)notesSource.Count(); NoteWindow newNote = new NoteWindow { noteId = noteCount, Visibility = Visibility.Visible, Title = "New Note" }; }
// When clicking a note's title in the notes section open a new window private void Title_Click(object sender, RoutedEventArgs e) { Note selectedNote = (Note)NotesTable.SelectedItem; NoteWindow newWindow = new NoteWindow { Visibility = Visibility.Visible, Title = selectedNote.Title }; newWindow.TitleTextBox.Text = selectedNote.Title; newWindow.TextBox.Text = selectedNote.Text; newWindow.noteId = selectedNote.Id; newWindow.HighPriorityCheckbox.IsChecked = selectedNote.HighPriority; }