TreeHelper.

GetVisualAncestor<T>(DependencyObject?) Method

Summary

Tries to find and returns a visual ancestor, 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 T GetVisualAncestor<T>(this DependencyObject? leaf) where T : DependencyObject

Type Parameters

Name Description
T

Parameters

Name Type Description
leaf DependencyObject? The starting object.

Return Value

Type Description
T