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


Type: System.Windows.Controls.Control
The control to transition between states.
Type: System.Windows.FrameworkElement
The root element of the control's ControlTemplate.
Type: System.String
The name of the state to transition to.
Type: System.Windows.VisualStateGroup
The VisualStateGroup that the state belongs to.
Type: System.Windows.VisualState
The representation of the state to transition to.
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

© 2016 Microsoft