Table of Contents

Method GetChildViewOfType

Namespace
Alternet.UI
Assembly
Alternet.UI.Maui.dll

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

parent IView

The 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

T

The 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.