private void TaskTypeListBox_Delete(object sender, RoutedEventArgs e) { MessageBoxResult messageBoxResult = MessageBox.Show("Are you sure?", "Delete task type confirmation", MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { try { DbAdapter.DeleteTaskType(this.Participant.Name, this.Planner.Name, TaskTypeListBox.SelectedItem.ToString()); AdjustPlannerDataGrid(); AdjustTaskTypeListBox(); AdjustPlannerDetailsTextBox(); } catch (Exception exception) { MessageBox.Show(exception.Message); } } }