Пример #1
0
        public MasterViewModel( IDataService dataService, IEventAggregator eventAggregator, IRegionManager regionManager )
        {
            _dataService = dataService;
            _eventAggregator = eventAggregator;
            _regionManager = regionManager;

            // Get the data model from the data service.
            _model = dataService.GetModel();

            // Initialize the CollectionView for the underlying model.
            DataItemsCV = new ListCollectionView( _model );
            // Track the current selection.
            DataItemsCV.CurrentChanged += new EventHandler( SelectedItemChanged );

            // Initialize the commands.
            NavigateToViewCommand = new DelegateCommand<string>( NavigateToView );
            SyncViewCommand = new DelegateCommand<string>( SyncView );
        }