public MainViewModel() { AddProductCommand = new MyCommand(AddProduct); ModifyProductCommand = new MyCommand(ModifyProduct); DeleteProductCommand = new MyCommand(DeleteProduct); ChangeSelectedProduct = new MyCommand(OnProductChanged); ProductRepository = new ProductRepostiory(); ProductRepository.ChangeInCollection += OnProductsChanged; Products = ProductRepository.GetAllProduct(); Product = new Product(); Product.SellStartDate = DateTime.Now; InitComboBox(); if (Product != null) { InitModifyProduct(); } }
public MainWindowModel() { FireCommand = new MyCommand(Fire); }