private void ModifyPatientClick(object sender, RoutedEventArgs e) { if (_vm.SelectedPatient != null) { PatientFormViewModel viewModel = new PatientFormViewModel(_vm.SelectedPatient); PatientFormWindow productForm = new PatientFormWindow { DataContext = viewModel }; productForm.ShowDialog(); } }
private void NewPatientClick(object sender, RoutedEventArgs e) { PatientFormViewModel viewModel = new PatientFormViewModel(new Patient()) { IsNew = true }; PatientFormWindow patientForm = new PatientFormWindow { DataContext = viewModel }; patientForm.ShowDialog(); _vm.PatientList.Add(viewModel.Patient); }