When overridden in a derived class, transitions a control between states.
protected virtual bool GoToStateCore( Control control, FrameworkElement templateRoot, string stateName, VisualStateGroup group, VisualState state, bool useTransitions )
The control to transition between states.
The root element of the control's ControlTemplate.
The name of the state to transition to.
The VisualStateGroup that the state belongs to.
The representation of the state to transition to.
true to use a VisualTransition to transition between states; otherwise, false.
true if the control successfully transitions to the new state; otherwise, false.
This API is part of the scenario of defining a custom VisualStateManager behavior. Overriding GoToStateCore changes the state behavior in your custom class behavior.
To reference your custom VisualStateManager class, set the value of the VisualStateManager.CustomVisualStateManager attached property within any control template where you want to use the custom VisualStateManager class behavior. You typically create an instance of the custom VisualStateManager class through default XAML construction in Application.Resources. Then the VisualStateManager.CustomVisualStateManager attached property is set using a StaticResource reference to the key of the custom VisualStateManager resource.
- If the VisualState as named by stateName has a Storyboard, the storyboard begins.
- If the VisualState that the control was using prior to the newly requested state has a Storyboard, that storyboard stops.
If a VisualState for stateName doesn't exist in the group, your implementation should return false.
If the control is already in the VisualState requested as stateName, your implementation should return true.
For more info on the default behavior, see GoToState.
CurrentStateChanging fires when the control begins to transition states as requested by the GoToState call. If a VisualTransition is applied to the state change, this event occurs when the transition begins.
However, if a state change transition is interrupted by a new GoToState call, the CurrentStateChanged event is never raised for the first state transition. A new event series is fired for the next requested state change.
Overriding the behavior of RaiseCurrentStateChanged and RaiseCurrentStateChanging is optional: how and when the events are raised by the default implementation might be adequate for your custom class.
Minimum supported client
Minimum supported server
|Windows Server 2012|
Build date: 11/16/2013