예제 #1
0
        private void Submit(object sender, RoutedEventArgs e)
        {
            TreatmentSheetViewModel model = (TreatmentSheetViewModel)DataContext;

            if (model.Valid())
            {
                DialogResult = true;
            }
        }
예제 #2
0
        private void ButtoTreatmentSheetClick(object sender, RoutedEventArgs e)
        {
            TreatmentSheetViewModel model = new TreatmentSheetViewModel {
                Patient = mainModel.SelectedPatient
            };
            TreatmentSheet window = new TreatmentSheet {
                DataContext = model
            };

            window.ShowDialog();
            if (window.DialogResult == true)
            {
                mainModel.SelectedPatient.TreatmentList.Add(model.NewTreatment);
            }
        }