VisualStateUtilities.TryFindNearestStatefulControl Method

Find the nearest parent which contains visual states.

Namespace: Microsoft.Expression.Interactivity
Assembly: Microsoft.Expression.Interactions (in microsoft.expression.interactions.dll)


Public Shared Function TryFindNearestStatefulControl ( _
    contextElement As FrameworkElement, _
    <OutAttribute> ByRef resolvedControl As FrameworkElement _
) As Boolean
Dim contextElement As FrameworkElement
Dim resolvedControl As FrameworkElement
Dim returnValue As Boolean

returnValue = VisualStateUtilities.TryFindNearestStatefulControl(contextElement, resolvedControl)
public static bool TryFindNearestStatefulControl (
    FrameworkElement contextElement,
    out FrameworkElement resolvedControl
static bool TryFindNearestStatefulControl (
    FrameworkElement^ contextElement, 
    [OutAttribute] FrameworkElement^% resolvedControl
public static boolean TryFindNearestStatefulControl (
    FrameworkElement contextElement, 
    /** @attribute OutAttribute() */ /** @ref */ FrameworkElement resolvedControl



The element from which to find the nearest stateful control.


The nearest stateful control if True; else null.

Return Value

True if a parent contains visual states; else False.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also


VisualStateUtilities Class
VisualStateUtilities Members
Microsoft.Expression.Interactivity Namespace