GetVisualAncestors Method
GetVisualAncestors(DependencyObject)
Gets all ancestors in the visual tree (including visual
itself).
Returns an empty list if visual
is null or not a visual.
Declaration
public static IEnumerable<DependencyObject> GetVisualAncestors(this DependencyObject visual)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | visual |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Windows.DependencyObject> |