FindLogicalAncestor(ILogical, Boolean) Method

Definition

Assembly HeadlessTestingFramework.dll

Finds the first logical ancestor of a specific type.

public static T? FindLogicalAncestor<T>(this ILogical logical, bool includeSelf = false)
    where T : class

Type parameters

T
The type of ancestor to find.

Parameters

logical
Avalonia.LogicalTree.ILogical

The logical to start from.

includeSelf
Boolean

Whether to include the logical itself in the search.

Returns

{T}
The first ancestor of the specified type, or null if not found.