private void BtnSaveAndClose_Click(object sender, RoutedEventArgs e) { bool success = SaveChanges(); if (success) { taskList.SaveList(); Close(); } }
private void BtnCompleted_Click(object sender, RoutedEventArgs e) { if (DgTasks.SelectedIndex == -1) { MessageBox.Show("No task selected.", "Error", MessageBoxButton.OK); return; } Task task = (Task)DgTasks.SelectedItem; task.Completed = !task.Completed; taskList.SaveList(); ReloadGrid(false); }