Ejemplo n.º 1
0
        /// <summary>
        /// Raises the EnabledChanged event.
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected override void OnEnabledChanged(EventArgs e)
        {
            // Push correct palettes into the view
            if (Enabled)
            {
                _drawDocker.SetPalettes(_stateNormal.Back, _stateNormal.Border);
                _drawContent.SetPalette(_stateNormal.Content);
            }
            else
            {
                _drawDocker.SetPalettes(_stateDisabled.Back, _stateDisabled.Border);
                _drawContent.SetPalette(_stateDisabled.Content);
            }

            _drawDocker.Enabled  = Enabled;
            _drawContent.Enabled = Enabled;

            // Update state to reflect change in enabled state
            _buttonManager.RefreshButtons();

            // Change in enabled state requires a layout and repaint
            PerformNeedPaint(true);

            // Let base class fire standard event
            base.OnEnabledChanged(e);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Update the visible state of the navigation buttons.
 /// </summary>
 /// <param name="prev">Show the previous button.</param>
 /// <param name="next">Show the next button.</param>
 public void UpdateButtons(bool prev, bool next)
 {
     _arrowPrev.Visible = prev;
     _arrowNext.Visible = next;
     _buttonManager.RefreshButtons();
 }