public PrescriptionEditViewModel(PrescriptionListViewModel prescriptionListViewModel, PrescriptionListWindow prescriptionListView, Prescription prescription) { PrescriptionListViewModel = prescriptionListViewModel; PrescriptionListView = prescriptionListView; if (prescription != null) { PrescriptionExists = true; Prescription = prescription; } else { //Add prescription PrescriptionExists = false; Prescription = new Prescription() { Date = DateTime.Now.Date }; } ShowPrescriptionEditView(); }
public void PrescriptionList(Medicine medicine) { _ = new PrescriptionListViewModel(MainView, medicine); MainView.DataContext = null; MainView.DataContext = this; }