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();
            }
        }
Пример #2
0
 public MainWindowModel()
 {
     FireCommand = new MyCommand(Fire);
 }