コード例 #1
0
        private void BtnSaveAndClose_Click(object sender, RoutedEventArgs e)
        {
            bool success = SaveChanges();

            if (success)
            {
                taskList.SaveList();
                Close();
            }
        }
コード例 #2
0
        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);
        }