Ejemplo n.º 1
0
        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>();
        }
Ejemplo n.º 2
0
 public NavigationViewModel(ICustomerLookupDataService customerLookupService,
                            IEventAggregator eventAggregator,
                            ICampaignLookupDataService campaignLookupService)
 {
     _customerLookupService = customerLookupService;
     _campaignLookupService = campaignLookupService;
     _eventAggregator       = eventAggregator;
     Customers = new ObservableCollection <NavigationItemViewModel>();
     Campaigns = new ObservableCollection <NavigationItemViewModel>();
     _eventAggregator.GetEvent <AfterDetailSavedEvent>().Subscribe(AfterDetailSaved);
     _eventAggregator.GetEvent <AfterDetailDeletedEvent>().Subscribe(AfterDetailDeleted);
 }
Ejemplo n.º 3
0
 public NavigationViewModel(ICustomerLookupDataService customerLookupService,
                            IProviderLookupDataService providerLookupService,
                            IProductLookupDataService productLookupService,
                            IOrderLookupDataService orderLookupService,
                            IEventAggregator eventAggregator)
 {
     _customerLookupService = customerLookupService;
     _providerLookupService = providerLookupService;
     _productLookupService  = productLookupService;
     _orderLookupService    = orderLookupService;
     _eventAggregator       = eventAggregator;
     Customers = new ObservableCollection <NavigationItemViewModel>();
     Providers = new ObservableCollection <NavigationItemViewModel>();
     Products  = new ObservableCollection <NavigationItemViewModel>();
     Orders    = new ObservableCollection <NavigationItemViewModel>();
     _eventAggregator.GetEvent <AfterDetailSavedEvent>().Subscribe(AfterDetailSaved);
     _eventAggregator.GetEvent <AfterDetailDeletedEvent>().Subscribe(AfterDetailDeleted);
 }