public OrderDetailViewModel(IEventAggregator eventAggregator, IOrderRepository orderRepository, IMessageDialogService messageDialogService, ICustomerLookupDataService customerLookupDataService, IOrderStateLookupDataService orderStateLookupDataService, IProductTypeLookupDataService productTypeLookupDataService) : base(eventAggregator, messageDialogService) { _orderRepository = orderRepository; _customerLookupDataService = customerLookupDataService; _orderStateLookupDataService = orderStateLookupDataService; _productTypeLookupDataService = productTypeLookupDataService; eventAggregator.GetEvent <AfterDetailSavedEvent>().Subscribe(AfterDetailSaved); eventAggregator.GetEvent <AfterDetailDeletedEvent>().Subscribe(AfterDetailDeleted); AddedProducts = new ObservableCollection <Product>(); AvailableProducts = new ObservableCollection <Product>(); AddProductCommand = new DelegateCommand(OnAddProductExecute, OnAddProductCanExecute); RemoveProductCommand = new DelegateCommand(OnRemoveProductExecute, OnRemoveProductCanExecute); OrderItems = new ObservableCollection <OrderItemWrapper>(); Customers = new ObservableCollection <LookupItem>(); OrderStates = new ObservableCollection <LookupItem>(); ProductTypes = new ObservableCollection <LookupItem>(); }
public ProductDetailViewModel(IEventAggregator eventAggregator, IMessageDialogService messageDialogService, IProductRepository productRepository, IProductTypeLookupDataService productTypeLookupDataService, IProductDiscountLookupDataService productDiscountLookupDataService, IProviderLookupDataService providerLookupDataService, IProductMeasureLookupDataService productMeasureLookupDataService) : base(eventAggregator, messageDialogService) { _productRepository = productRepository; _productTypeLookupDataService = productTypeLookupDataService; _productDiscountLookupDataService = productDiscountLookupDataService; _providerLookupDataService = providerLookupDataService; _productMeasureLookupDataService = productMeasureLookupDataService; eventAggregator.GetEvent <AfterCollectionSavedEvent>().Subscribe(AfterCollectionSaved); ProductTypes = new ObservableCollection <LookupItem>(); ProductDiscounts = new ObservableCollection <LookupItem>(); Providers = new ObservableCollection <LookupItem>(); ProductMeasures = new ObservableCollection <LookupItem>(); }