private void DeleteSelectedPatient(PatientToBeDeleted patientToBeDeleted) { //AllPatients.Remove(patientToBeDeleted.PatientToBeDeletedProperty); _patientDataService.DeletePatient(patientToBeDeleted.PatientToBeDeletedProperty); _dialogService.ClosePatientsDetailDialog(); var allPatients = _patientDataService.GetAllPatients(); var patientViewModels = allPatients.Select(x => PatientViewModel.FromModel(x)); AllPatients.Clear(); foreach (var patient in patientViewModels) { AllPatients.Add(patient); } }