WinRTXamlToolkit.Controls.Primitives.CalendarButton.ChangeVisualState C# (CSharp) Method

ChangeVisualState() private method

Change to the correct visual state for the button.
private ChangeVisualState ( bool useTransitions ) : void
useTransitions bool /// True to use transitions when updating the visual state, false to /// snap directly to the new visual state. ///
return void
        internal void ChangeVisualState(bool useTransitions)
        {
            // Update the SelectionStates group
            if (IsSelected)
            {
                VisualStates.GoToState(this, useTransitions, VisualStates.StateSelected, VisualStates.StateUnselected);
            }
            else
            {
                VisualStates.GoToState(this, useTransitions, VisualStates.StateUnselected);
            }

            // Update the ActiveStates group
            if (IsInactive)
            {
                VisualStates.GoToState(this, useTransitions, VisualStates.StateInactive);
            }
            else
            {
                VisualStates.GoToState(this, useTransitions, VisualStates.StateActive, VisualStates.StateInactive);
            }

            // Update the FocusStates group
            if (IsCalendarButtonFocused && IsEnabled)
            {
                VisualStates.GoToState(this, useTransitions, VisualStates.StateCalendarButtonFocused, VisualStates.StateCalendarButtonUnfocused);
            }
            else
            {
                VisualStates.GoToState(this, useTransitions, VisualStates.StateCalendarButtonUnfocused);
            }
        }
    }