コード例 #1
0
 /// <summary>
 /// This method is invoked when the pointer enters the rating item.
 /// </summary>
 /// <param name="e">Information about the event.</param>
 protected override void OnPointerEntered(PointerRoutedEventArgs e)
 {
     if (_interactionHelper.AllowPointerEnter(e))
     {
         _interactionHelper.UpdateVisualStateBase(true);
     }
     base.OnPointerEntered(e);
 }
コード例 #2
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);
 }
コード例 #3
0
        /// <summary>
        /// Change to the correct visual state for the repeatbutton.
        /// </summary>
        internal void UpdateVisualState(bool useTransitions)
        {
            // all states are managed by the default InteractionHelper
            Interaction.UpdateVisualStateBase(useTransitions);

            if (ElementFocusVisual != null)
            {
                ElementFocusVisual.Visibility = (IsFocused && IsEnabled) ?
                                                Visibility.Visible : Visibility.Collapsed;
            }
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
 /// <summary>
 /// Change to the correct visual state for the thumb.
 /// </summary>
 internal void UpdateVisualState(bool useTransitions)
 {
     // all states are managed by the default InteractionHelper
     Interaction.UpdateVisualStateBase(useTransitions);
 }