Method GetChildViewOfType
GetChildViewOfType<T>(IView)
Searches the visual tree of the specified parent view and returns the first child view of the specified type, if found.
public static T? GetChildViewOfType<T>(IView parent) where T : View
Parameters
parentIViewThe root view whose visual tree will be searched for a child of type T.
Returns
- T
An instance of type T if a matching child view is found; otherwise, null.
Type Parameters
TThe type of view to search for. Must be a subclass of View.
Remarks
The search is performed recursively through the visual tree, including nested layouts and content views. Only the first matching child view is returned. If no child of the specified type is found, the method returns null.