GoToStateCore Method

VisualStateManager.GoToStateCore Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Transitions a control between states.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

protected virtual bool GoToStateCore(
	Control control,
	FrameworkElement templateRoot,
	string stateName,
	VisualStateGroup group,
	VisualState state,
	bool useTransitions
)

Parameters

control
Type: System.Windows.Controls.Control
The control to transition between states.
templateRoot
Type: System.Windows.FrameworkElement
The root element of the control's ControlTemplate.
stateName
Type: System.String
The name of the state to transition to.
group
Type: System.Windows.VisualStateGroup
The VisualStateGroup that the state belongs to.
state
Type: System.Windows.VisualState
The representation of the state to transition to.
useTransitions
Type: System.Boolean
true to use a VisualTransition to transition between states; otherwise, false.

Return Value

Type: System.Boolean
true if the control successfully transitioned to the new state; otherwise, false.

Override the GoToStateCore method. Then set the VisualStateManager.CustomVisualStateManager attached property on the control that uses the custom logic.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2016 Microsoft