VisualStateUtilities.FindNearestStatefulControl Method

Finds the nearest parent which contains visual states.

Namespace:  Microsoft.Xaml.Interactivity
Assembly:  Microsoft.Xaml.Interactivity (in Microsoft.Xaml.Interactivity.dll)

Syntax

'Declaration
Public Shared Function FindNearestStatefulControl ( _
    element As FrameworkElement _
) As Control
public static Control FindNearestStatefulControl(
    FrameworkElement element
)
public:
static Control^ FindNearestStatefulControl(
    FrameworkElement^ element
)
static member FindNearestStatefulControl : 
        element:FrameworkElement -> Control
public static function FindNearestStatefulControl(
    element : FrameworkElement
) : Control

Parameters

  • element
    Type: FrameworkElement

    The FrameworkElement from which to find the nearest stateful control.

Return Value

Type: Control
The nearest Control that contains visual states; otherwise, nulla null reference (Nothing in Visual Basic).

Exceptions

Exception Condition
ArgumentNullException

element is null.

.NET Framework Security

See Also

Reference

VisualStateUtilities Class

Microsoft.Xaml.Interactivity Namespace