示例#1
0
        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();
        }
示例#2
0
 public void StockList(Medicine medicine)
 {
     _ = new StockListViewModel(MainView, medicine);
     MainView.DataContext = null;
     MainView.DataContext = this;
 }