Пример #1
0
        private void NewTask_Click(object sender, RoutedEventArgs e)
        {
            EditDialog newDialog = new EditDialog(new TaskType());

            newDialog.Owner = this; //For centering on parent
            if (newDialog.ShowDialog() == true)
            {
                taskList.Add(newDialog.currentTask);
            }
        }
Пример #2
0
 private void EditTask_Click(object sender, RoutedEventArgs e)
 {
     if (taskListBox.SelectedItem != null)
     {
         int        currentIndex = taskListBox.SelectedIndex;
         EditDialog newDialog    = new EditDialog(taskList[currentIndex].ShallowCopy());
         newDialog.Owner = this; //For centering on parent
         if (newDialog.ShowDialog() == true)
         {
             taskList[currentIndex] = newDialog.currentTask;
         }
     }
 }