Exemple #1
0
 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();
     }
 }
Exemple #2
0
        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);
        }