TreeHelper.

GetVisualAncestry(DependencyObject?) Method

Summary

Returns full visual ancestry, starting at the leaf.

If element is not of Visual or Visual3D the logical ancestry is used.

Namespace
MahApps.Metro.Controls
Containing Type
TreeHelper

Syntax

public static IEnumerable<DependencyObject> GetVisualAncestry(this DependencyObject? leaf)

Parameters

Name Type Description
leaf DependencyObject? The starting object.

Return Value

Type Description
IEnumerable<DependencyObject>