Show / Hide Table of Contents

Class VisualStateUtilities

This class provides various platform agnostic standard operations for working with VisualStateManager.

Inheritance
System.Object
VisualStateUtilities
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Microsoft.Expression.Interactivity
Assembly: OpenSilver.Expression.Interactions.dll
Syntax
public static class VisualStateUtilities

Methods

| Improve this Doc View Source

GetVisualStateGroups(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
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source