ExtensionMethods.FindAncestorOrSelf<TAncestorType> Method (Visual)
Visual Studio 2015
Finds the first ancestor of a given type in the logical or visual tree, or the object itself if it matches in type.
Assembly: Microsoft.VisualStudio.Utilities (in Microsoft.VisualStudio.Utilities.dll)
public static TAncestorType FindAncestorOrSelf<TAncestorType>( this Visual obj ) where TAncestorType : DependencyObject
Parameters
- obj
-
Type:
System.Windows.Media.Visual
The object at which to begin searching.
Return Value
Type: TAncestorTypeThe object itself, if it matches in type, else the first ancestor of type T in the parent chain of obj, or null if no ancestor is found.
Type Parameters
- TAncestorType
The type of ancestor to find.
Show: