Ejemplo n.º 1
0
        public ApplicationState()
        {
            IsServerHostedMode = false; //Assume locally-hosted book mode by default.
            SidePanelMode = SidePanelDisplayMode.Hidden;

            PlayerState = new PlayerState(this);
            DisplaySettingsState = new DisplaySettingsState();
            SearchState = new SearchState();
            NavigationState = new NavigationState();
        }
        /// <summary>
        /// This constructor initialises the dependent DisplaySettings view, and maintains references to
        /// the main Application Presenter and the Display Settings state (which holds properties such
        /// as current interface size and contrast scheme).
        /// </summary>
        /// <param name="mainPresenter"></param>
        /// <param name="viewReference"></param>
        /// <param name="state"></param>
        internal DisplaySettingsPresenter(IDisplaySettingsView viewReference, ApplicationPresenter mainPresenter,
            DisplaySettingsState state)
        {
            _mainPresenter = mainPresenter;
            _view = viewReference;
            _state = state;

            _view.ChangeInterfaceSize += ChangeInterfaceSize;
            _view.ChangeContrastScheme += ChangeContrastScheme;
            //_view.SpeakableElementSelected += _view_SpeakableElementSelected;
            //_view.SelfVoicingSpeakText += _view_SelfVoicingSpeakText;
            _view.UpdateInterfaceSize(_state.InterfaceSize);
            _view.UpdateContrastScheme(_state.ContrastScheme);

            _view.ApplicationView.DisplaySettingsFocusChanged += new System.EventHandler<PanelFocusedItemEventArgs>(ApplicationView_DisplaySettingsFocusChanged);
        }