public ProductListViewModel( IEventAggregator eventAggregator,
            ProductService productService,
            ProductVMContainer productVMContainer,
            IUnityContainer container,
            ProductExportToPdfService productExportToPdfService,
            DomainProductSrcriptExecuter scriptExecuter,
            AppStatusManager status
            )
        {

            this.container = container;
            this.scriptExecuter = scriptExecuter;
            this.productExportToPdfService = productExportToPdfService;
            this.eventAggregator = eventAggregator;
            this.productService = productService;
            this.productVMContainer = productVMContainer;
            this.status = status;

            this.cleanFilterTxtCommand = new DelegateCommand(() => this.FilterTxt = string.Empty);
            
            var dmProductList = productService.GetAllProduct();

            var list= dmProductList.Select(x =>
               CreateVM(container, x)
               ).ToList().OrderBy(x => x.DomainProduct.Brand).ThenBy(x => x.DomainProduct.Name);

            this.ProductList = new ObservableCollection<ProductItemViewModel>(list);
       
            this.ProductListCollectionView = CollectionViewSource.GetDefaultView(this.ProductList);
            this.ProductListCollectionView.Filter = FilterFunction;

            this.ScriptText = this.status.Get("DomainProduct.ScriptText", "");
            this.eventAggregator.GetEvent<ProductSellPriceChangedEvent>().Subscribe(ProductSellPriceChangedEventHandler);
             
        }
 public ProductItemViewModel(ProductService productService, 
     domain.Product domainProduct, 
     IEventAggregator eventAggregator,
     ProductPriceCalcuateService productPriceCalcuateService)
 {            
     this.productService = productService;
     this.productPriceCalcuateService = productPriceCalcuateService;
     this.eventAggregator = eventAggregator;
     this.domainProduct = domainProduct;
     this.domainProduct.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(domainProduct_PropertyChanged);
 }
        public SearchProductViewModel( 
            IEventAggregator eventAggregator,
            ProductService productService,
            IUnityContainer container,
            ProductVMContainer productVMContainer
            )
        {
            this.container = container;
            this.eventAggregator = eventAggregator;
            this.productService = productService;
            this.productVMContainer = productVMContainer;

            this.cleanFilterTxtCommand = new DelegateCommand(() => this.FilterTxt = string.Empty);

            Reload();

            this.eventAggregator.GetEvent<ProductSellPriceChangedEvent>()
                .Subscribe(ProductSellPriceChangedEventHandler);
            this.eventAggregator.GetEvent<SelectedItemsToCurrentBillEvent>()
                .Subscribe(SelectedItemsToCurrentBillEventHandler);

            this.eventAggregator.GetEvent<BillQuickActionEvent>()
                .Subscribe(BillQuickActionEventHandler);
           
        }
        public BillViewModel(BillService billService,
            ProductService productService,
            domain.Bill domainBill,
            IEventAggregator eventAggregator)
        {
            this.eventAggregator = eventAggregator;
            this.billService = billService;
            this.productService = productService;
            this.domainBill = domainBill;
            this.domainBill.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(domainBill_PropertyChanged);

            this.BillItemVMList = BuildBillItemVmList(this.domainBill);
        
        }