| ControlExtensionsParentElementOfTypeT Method |
From the given starting element, this will work up the visual tree until it finds a parent
element of the given type.
Namespace: SandcastleBuilder.WPFAssembly: SandcastleBuilder.WPF (in SandcastleBuilder.WPF.dll) Version: 2014.11.22.0
Syntax public static T ParentElementOfType<T>(
this FrameworkElement element
)
where T : FrameworkElement
<ExtensionAttribute>
Public Shared Function ParentElementOfType(Of T As FrameworkElement) (
element As FrameworkElement
) As T
public:
[ExtensionAttribute]
generic<typename T>
where T : FrameworkElement
static T ParentElementOfType(
FrameworkElement^ element
)
[<ExtensionAttribute>]
static member ParentElementOfType :
element : FrameworkElement -> 'T when 'T : FrameworkElement
Parameters
- element
- Type: System.WindowsFrameworkElement
The starting element
Type Parameters
- T
- The parent element type to find
Return Value
Type:
TThe parent element of the given type if found or null if not found
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
FrameworkElement. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also