private void Row_MouseDoubleClick_ApproveDrug(object sender, MouseButtonEventArgs e) { var data = (DataGrid)sender; Notification notification = (Notification)data.SelectedValue; if (notification == null) { return; } var drugId = Regex.Match(notification.Text, @"\d+").Value; Drug drug = _drugController.Get(Int32.Parse(drugId)); if (drug != null) { User user = _userController.GetLoggedUser(); Doctor doctor = _doctorController.Get(user.Id); drug = _drugController.Approve(drug.Id, doctor.Id); if (drug != null) { doctor.Notification.Remove(notification.Id); doctor = _doctorController.Update(doctor); List <Notification> notifications = new List <Notification>(); foreach (var notificationId in doctor.Notification) { notifications.Add(_notificationController.Get(notificationId)); } notificationDataGrid.ItemsSource = notifications; } } }