UpdateVisualStateBase() public method

Update the visual state of the control.
public UpdateVisualStateBase ( bool useTransitions ) : void
useTransitions bool /// A value indicating whether to automatically generate transitions to /// the new state, or instantly transition to the new state. ///
return void
コード例 #1
0
ファイル: RatingItem.cs プロジェクト: watchick/WpfToolkit
 /// <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);
 }
コード例 #2
0
        /// <summary>
        /// Update the current visual states.
        /// </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)
        {
            // Contained state
            VisualStateManager.GoToState(this, TimePickerParent == null ? NotContainedStateName : ContainedStateName, useTransitions);

            // Popup mode, visual states directly match enum names.
            VisualStateManager.GoToState(this, PopupTimeSelectionMode.ToString(), useTransitions);

            // Handle the Common and Focused states
            _interaction.UpdateVisualStateBase(useTransitions);
        }
コード例 #3
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);
        }