-
Home
-
API
-
Avalonia.HeadlessTestingFramework
-
LogicalTreeTestHelper
-
Methods
-
FindLogicalAncestor(ILogical, Func, Boolean)
FindLogicalAncestor(ILogical, Func<T, Boolean>, Boolean) Method
Definition
Finds a logical ancestor matching a predicate.
public static T? FindLogicalAncestor<T>(this ILogical logical, Func<T, bool> predicate, bool includeSelf = false)
where T : class
Type parameters
- T
- The type of ancestor to find.
Parameters
- includeSelf
- Boolean
Whether to include the logical itself in the search.
Returns
- {T}
- The first ancestor matching the predicate, or null if not found.