Exemple #1
0
 /// <summary>
 ///     This method is invoked when the mouse enters the rating item.
 /// </summary>
 /// <param name="e">Information about the event.</param>
 protected override void OnMouseEnter(MouseEventArgs e)
 {
     if (_interactionHelper.AllowMouseEnter(e))
     {
         _interactionHelper.UpdateVisualStateBase(true);
     }
     base.OnMouseEnter(e);
 }
        /// <summary>
        ///     Update the current visual state of the button.
        /// </summary>
        /// <param name="useTransitions">
        ///     True to use transitions when updating the visual state, false to
        ///     snap directly to the new visual state.
        /// </param>
        internal virtual void UpdateVisualState(bool useTransitions)
        {
            if (IsLocked)
            {
                VisualStates.GoToState(this, useTransitions, VisualStates.StateLocked);
            }
            else
            {
                VisualStates.GoToState(this, useTransitions, VisualStates.StateUnlocked);
            }

            switch (ExpandDirection)
            {
            case ExpandDirection.Down:
                VisualStates.GoToState(this, useTransitions, VisualStates.StateExpandDown);
                break;

            case ExpandDirection.Up:
                VisualStates.GoToState(this, useTransitions, VisualStates.StateExpandUp);
                break;

            case ExpandDirection.Left:
                VisualStates.GoToState(this, useTransitions, VisualStates.StateExpandLeft);
                break;

            default:
                VisualStates.GoToState(this, useTransitions, VisualStates.StateExpandRight);
                break;
            }

            // let the header know a change has possibly occured.
            if (ExpanderButton != null)
            {
                ExpanderButton.UpdateVisualState(useTransitions);
            }

            // Handle the Common and Focused states
            _interaction.UpdateVisualStateBase(useTransitions);
        }