Class VisualStateManager
Manages states and the logic for transitioning between states for controls.
Inherited Members
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public class VisualStateManager : DependencyObject
Fields
| Improve this Doc View SourceCustomVisualStateManagerProperty
Declaration
public static readonly DependencyProperty CustomVisualStateManagerProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Methods
| Improve this Doc View SourceGetCustomVisualStateManager(FrameworkElement)
Declaration
public static VisualStateManager GetCustomVisualStateManager(FrameworkElement obj)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | obj |
Returns
Type | Description |
---|---|
VisualStateManager |
GetVisualStateGroups(FrameworkElement)
Gets the VisualStateManager.VisualStateGroups attached property.
Declaration
public static IList GetVisualStateGroups(FrameworkElement obj)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | obj | The element to get the VisualStateManager.VisualStateGroups attached property from. |
Returns
Type | Description |
---|---|
System.Collections.IList | The collection of VisualStateGroup objects that is associated with the specified object. |
GoToElementState(FrameworkElement, String, Boolean)
Transitions a control's state.
Declaration
public static bool GoToElementState(FrameworkElement stateGroupsRoot, string stateName, bool useTransitions)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | stateGroupsRoot | The root element that contains the VisualStateManager. |
System.String | stateName | The new state that the control is in. |
System.Boolean | useTransitions | Whether to use transition animations. |
Returns
Type | Description |
---|---|
System.Boolean | true if the state changed successfully, false otherwise. |
GoToState(Control, String, Boolean)
Transitions the control between two states.
Declaration
public static bool GoToState(Control control, string stateName, bool useTransitions)
Parameters
Type | Name | Description |
---|---|---|
Control | control | The control to transition between states. |
System.String | stateName | The state to transition to. |
System.Boolean | useTransitions | True to use a VisualTransition to transition between states; otherwise, false. |
Returns
Type | Description |
---|---|
System.Boolean | True if the control successfully transitioned to the new state; otherwise, false. |
GoToStateCore(Control, FrameworkElement, String, VisualStateGroup, VisualState, Boolean)
Allows subclasses to override the GoToState logic.
Declaration
protected virtual bool GoToStateCore(Control control, FrameworkElement templateRoot, string stateName, VisualStateGroup group, VisualState state, bool useTransitions)
Parameters
Type | Name | Description |
---|---|---|
Control | control | |
FrameworkElement | templateRoot | |
System.String | stateName | |
VisualStateGroup | group | |
VisualState | state | |
System.Boolean | useTransitions |
Returns
Type | Description |
---|---|
System.Boolean |
RaiseCurrentStateChanged(VisualStateGroup, VisualState, VisualState, Control)
Declaration
protected void RaiseCurrentStateChanged(VisualStateGroup stateGroup, VisualState oldState, VisualState newState, Control control)
Parameters
Type | Name | Description |
---|---|---|
VisualStateGroup | stateGroup | |
VisualState | oldState | |
VisualState | newState | |
Control | control |
RaiseCurrentStateChanging(VisualStateGroup, VisualState, VisualState, Control)
Declaration
protected void RaiseCurrentStateChanging(VisualStateGroup stateGroup, VisualState oldState, VisualState newState, Control control)
Parameters
Type | Name | Description |
---|---|---|
VisualStateGroup | stateGroup | |
VisualState | oldState | |
VisualState | newState | |
Control | control |
SetCustomVisualStateManager(FrameworkElement, VisualStateManager)
Declaration
public static void SetCustomVisualStateManager(FrameworkElement obj, VisualStateManager value)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | obj | |
VisualStateManager | value |