コード例 #1
0
        protected MasterDetailsViewModelBase(ViewModelFactoryBase <TDomainClass> viewModelFactory,
                                             CatalogBase <TDomainClass> catalog)
        {
            // Sanity checks, so we don't need null checks elsewhere
            if (viewModelFactory == null)
            {
                throw new ArgumentNullException(nameof(viewModelFactory));
            }
            if (catalog == null)
            {
                throw new ArgumentNullException(nameof(catalog));
            }

            _catalog          = catalog;
            _viewModelFactory = viewModelFactory;

            _masterViewModel       = _viewModelFactory.CreateMasterViewModel();
            _detailsViewModel      = null;
            _itemViewModelSelected = null;

            _stateManager = new ViewControlStateManager();
            _viewState    = ViewControlState.ViewState.Read;

            SetupViewStateCommands();
            SetupViewActionControllers();
        }
コード例 #2
0
        protected MasterDetailsViewModelBase(ViewModelFactoryBase <TDomainClass> viewModelFactory,
                                             DomainModelBase <TDomainClass> domainModel)
        {
            _domainModel      = domainModel;
            _viewModelFactory = viewModelFactory;

            _masterViewModel       = _viewModelFactory.CreateMasterViewModel();
            _detailsViewModel      = null;
            _itemViewModelSelected = null;

            _stateManager = new ViewControlStateManager();
            _viewState    = ViewControlState.ViewState.Read;

            SetupViewStateCommands();
            SetupViewActionControllers();
        }