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