public RefillMedicineWindow(RefillMedicineViewModel viewModel) { InitializeComponent(); this.DataContext = viewModel; }
private void RefillMedicine(string medicineName) { var viewModel = new RefillMedicineViewModel { MedicineName = medicineName }; var window = new RefillMedicineWindow(viewModel); if (window.ShowDialog() == true) { this.supplies.Refill(new Medicine(medicineName), new Stock(viewModel.Count, viewModel.Date.Date)); this.OnSuppliesChanged(); this.DumpSuppliesStatus(); } }