VisualExtensions.

FindDescendantOfType<T>(IVisual, bool) Method

Summary

Finds first descendant of given type.
Namespace
Avalonia.VisualTree
Containing Type
VisualExtensions

Syntax

public static T FindDescendantOfType<T>(this IVisual visual, bool includeSelf = false) 
    where T : class

Type Parameters

Name Description
T Descendant type.

Parameters

Name Type Description
visual IVisual The visual.
includeSelf bool If given visual should be included in search.

Return Value

Type Description
T First descendant of given type.