public RefillAllMedicinesWindow(RefillAllMedicinesViewModel viewModel) { InitializeComponent(); this.DataContext = viewModel; }
private void RefillAllMedicine() { var viewModel = new RefillAllMedicinesViewModel(this.supplies.GetMedicines().Select(x => x.Name)); var window = new RefillAllMedicinesWindow(viewModel); if (window.ShowDialog() == true) { this.supplies.Refill(viewModel.Stocks.Where(x => x.Count > 0).ToDictionary(x => new Medicine(x.MedicineName), x => new Stock(x.Count, viewModel.Date.Date))); this.OnSuppliesChanged(); this.DumpSuppliesStatus(); } }