Esempio n. 1
0
 private void AddCommandHandler()
 {
     _currentCommand = Definitions.Enumeration.Commands.AddProduct;
     InitializeNewProduct();
     NewProductFormVisibility = true;
     EnableProductList        = false;
 }
Esempio n. 2
0
        public ProductRegistrationViewModel(IUnityContainer container)
        {
            // Resolve services
            _regionManager   = container.Resolve <IRegionManager>();
            _productService  = container.Resolve <IProductService>();
            _eventAggregator = container.Resolve <IEventAggregator>();

            // Get data from Database
            Initialization = InitializeProductListAsync();

            ProductListView.MoveCurrentToFirst();

            _title                   = "-Product Management Title-";
            _currentCommand          = Definitions.Enumeration.Commands.None;
            NewProductFormVisibility = false;
            EnableProductList        = true;
            SetProductValidationRules();

            // Event Handler
            OnFirstCommand    = new DelegateCommand(FirstCommandHandler);
            OnPreviousCommand = new DelegateCommand(PreviousCommandHandler);
            OnNextCommand     = new DelegateCommand(NextCommandHandler);
            OnLastCommand     = new DelegateCommand(LastCommandHandler);
            OnAddCommand      = new DelegateCommand(AddCommandHandler);

            OnEditProductCommand   = new DelegateCommand <ProductModel>(EditProductCommandHandler);
            OnSaveCommand          = new DelegateCommand(SaveCommandHandler);
            OnDeleteProductCommand = new DelegateCommand <ProductModel>(DeleteProductCommandHandler);

            OnCancelCommand      = new DelegateCommand(CancelCommandHandler);
            OnCloseCommand       = new DelegateCommand(CloseCommandHandler);
            OnSelectImageCommand = new DelegateCommand(SelectImageHandler);
        }
Esempio n. 3
0
 private void EditProductCommandHandler(ProductModel product)
 {
     _currentCommand   = Definitions.Enumeration.Commands.EditProduct;
     EnableProductList = false;
 }