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(); }
/// <summary> /// Call this version if the property state /// is valid for a specific state /// </summary> /// <param name="viewState"></param> /// <param name="state"></param> public void AddViewControlState(ViewControlState.ViewState viewState, ViewControlState state) { // Add name, if not seen before if (!_controlNames.Contains(state.PropertyName)) { _controlNames.Add(state.PropertyName); } _viewControlStateMap[viewState].Add(state.PropertyName, state); }
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(); }
public Dictionary <string, ViewControlState> GetViewControlStates(ViewControlState.ViewState viewState) { return(_viewControlStateMap[viewState]); }