Ejemplo n.º 1
0
 protected virtual void SetupControlBehaviors(
     CRUDControlStateService stateService,
     List <string> immutableControls, List <string> mutableControls)
 {
     stateService.AddImmutableControlsDefaultStates(immutableControls);
     stateService.AddMutableControlsDefaultStates(mutableControls);
     stateService.AddCRUDInvokerDefaultStates();
     stateService.AddStateSelectorDefaultStates();
     stateService.AddItemSelectorDefaultStates();
 }
Ejemplo n.º 2
0
        protected PageViewModelCRUD(
            ICatalog <TViewData> catalog,
            List <string> immutableControls,
            List <string> mutableControls)
            : base(catalog)
        {
            CRUDControlStateService CRUDcontrolStateService = new CRUDControlStateService();

            SetupControlBehaviors(CRUDcontrolStateService, immutableControls, mutableControls);

            // Set state services to refer to CRUD-specific services
            ViewStateService    = new CRUDViewStateService();
            ControlStateService = CRUDcontrolStateService;

            SetupCommandManagers(catalog);
            SetupInitialViewState();

            // Set mediator to a state-aware implementation
            _mediator = new PageViewModelCRUDMediator <TViewData>(this, catalog);
        }