private void onDelete() { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Warning); if (messageBoxResult == MessageBoxResult.Yes) { RecRepo.DeleteRecordsAsync(SelectedRecord.Id); ReportRecords.Remove(SelectedRecord); SelectedRecord = null; } }