Click or drag to resize

VisualTreeHelperExtensionsFindAncestorT Method

Finds a specific ancestor of a dependency object.

Namespace:  Ptv.XServer.Controls.Map
Assembly:  Ptv.XServer.Controls.Map (in Ptv.XServer.Controls.Map.dll) Version: 1.7.10.0
Syntax
public static T FindAncestor<T>(
	this DependencyObject obj
)
where T : DependencyObject

Parameters

obj
Type: System.WindowsDependencyObject
Dependency object to find the ancestor for.

Type Parameters

T
Type to lookup

Return Value

Type: T
Found ancestor or null.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DependencyObject. 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