private void btnAddTask_Click(object sender, RoutedEventArgs e) { AddTaskWindow addTask = new AddTaskWindow(); addTask.Owner = this; addTask.Show(); }
private void btnEditTask_Click(object sender, RoutedEventArgs e) { if (lbTasks.SelectedIndex >= 0) { AddTaskWindow editTask = new AddTaskWindow("edit", (DbLibrary.Task)lbTasks.SelectedItem); editTask.Owner = this; editTask.Show(); } else { MessageBox.Show("Choose a task"); } }