private void DeleteButtonClick(object sender, RoutedEventArgs e) { MessageBoxResult result = MessageBox.Show("Do you really want to delete \'" + Task.Name + "\'?", "Confirmation", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { TaskModel.DeleteById(Task.ID); Project.CloseCreateDialog(); OpenProjectView(); } }