public StockEditViewModel(StockListViewModel stockListViewModel, StockListWindow stockListView, Stock stock) { StockListViewModel = stockListViewModel; StockListView = stockListView; if (stock != null) { StockExists = true; Stock = stock; } else { //Add stock StockExists = false; Stock = new Stock() { Date = DateTime.Now.Date }; } ShowStockEditView(); }
public void StockList(Medicine medicine) { _ = new StockListViewModel(MainView, medicine); MainView.DataContext = null; MainView.DataContext = this; }