Telerik UI for Windows Phone by Progress

Finds a visual ancestor from a given type and based on a given condition that is in the parent chain of a given child element.

Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Core (in Telerik.Windows.Core.dll) Version: 2013.1.422.2040 (2013.1.0422.2040)

Syntax

C#
public static T FindVisualAncestor<T>(
	DependencyObject child,
	Predicate<DependencyObject> condition = null
)
where T : class
Visual Basic
Public Shared Function FindVisualAncestor(Of T As Class) ( _
	child As DependencyObject, _
	Optional condition As Predicate(Of DependencyObject) = Nothing _
) As T
Visual C++
public:
generic<typename T>
where T : ref class
static T FindVisualAncestor(
	DependencyObject^ child, 
	Predicate<DependencyObject^>^ condition = nullptr
)

Parameters

child
Type: System.Windows..::..DependencyObject
The child.
condition (Optional)
Type: System..::..Predicate<(Of <(<'DependencyObject>)>)>
The condition.

Type Parameters

T
The type of the element to look for.

Return Value

An instance of the given type if found, otherwise null.

See Also