Ejemplo n.º 1
0
        public OrderListViewModel( OrderContext orderService, IEventAggregator eventAggregator )
        {
            // Event aggregator for publishing loosely coupled events.
            _eventAggregator = eventAggregator;

            // Order service context for loading Order data from web service.
            _orderService = orderService;

            // Wrap the order entity list in a PagedCollectionView.
            _orderCollectionView = new PagedCollectionView( _orderService.Orders );

            // Track the currently selected item.
            _orderCollectionView.CurrentChanged += SelectedOrderChanged;

            // Start loading the orders collection using the order service.
            LoadOperation load = _orderService.Load( _orderService.GetOrdersQuery(), OnOrdersLoaded, null );
        }
Ejemplo n.º 2
0
        public OrderListViewModel(OrderContext orderService, IEventAggregator eventAggregator)
        {
            // Event aggregator for publishing loosely coupled events.
            _eventAggregator = eventAggregator;

            // Order service context for loading Order data from web service.
            _orderService = orderService;

            // Wrap the order entity list in a PagedCollectionView.
            _orderCollectionView = new PagedCollectionView(_orderService.Orders);

            // Track the currently selected item.
            _orderCollectionView.CurrentChanged += SelectedOrderChanged;

            // Start loading the orders collection using the order service.
            LoadOperation load = _orderService.Load(_orderService.GetOrdersQuery(), OnOrdersLoaded, null);
        }