Class VisualStateUtilities
This class provides various platform agnostic standard operations for working with VisualStateManager.
Inheritance
Inherited Members
Namespace: Microsoft.Expression.Interactivity
Assembly: OpenSilver.Expression.Interactions.dll
Syntax
public static class VisualStateUtilities
Methods
| Improve this Doc View SourceGetVisualStateGroups(FrameworkElement)
Gets the value of the VisualStateManager.VisualStateGroups attached property.
Declaration
public static IList GetVisualStateGroups(FrameworkElement targetObject)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | targetObject | The element from which to get the VisualStateManager.VisualStateGroups. |
Returns
Type | Description |
---|---|
System.Collections.IList |
GoToState(FrameworkElement, String, Boolean)
Transitions the control between two states.
Declaration
public static bool GoToState(FrameworkElement element, string stateName, bool useTransitions)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | element | The element to transition between states. |
System.String | stateName | The state to transition to. |
System.Boolean | useTransitions | True to use a System.Windows.VisualTransition to transition between states; otherwise, false. |
Returns
Type | Description |
---|---|
System.Boolean | True if the control successfully transitioned to the new state; otherwise, false. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Control is null. |
System.ArgumentNullException | StateName is null. |
TryFindNearestStatefulControl(FrameworkElement, out FrameworkElement)
Find the nearest parent which contains visual states.
Declaration
public static bool TryFindNearestStatefulControl(FrameworkElement contextElement, out FrameworkElement resolvedControl)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | contextElement | The element from which to find the nearest stateful control. |
FrameworkElement | resolvedControl | The nearest stateful control if True; else null. |
Returns
Type | Description |
---|---|
System.Boolean | True if a parent contains visual states; else False. |