Skip to content

Applies to

net10.0-android36.0

Overloads

  1. protected LayoutViewHost()

  2. protected LayoutViewHost(Context context, int layoutId, ViewGroup parent, bool attachToRoot)

  3. protected LayoutViewHost(Context context, int layoutId, ViewGroup parent, bool attachToRoot, Action<LayoutViewHost, View> bind)

1. Overload

protected LayoutViewHost()

View source

Summary: Initializes a new instance of the LayoutViewHost class.

Remarks

        This constructor performs no inflation or wiring and exists to support
        derived types that manage view creation manually.

2. Overload

protected LayoutViewHost(Context context, int layoutId, ViewGroup parent, bool attachToRoot)

View source

Summary: Initializes a new instance of the LayoutViewHost class by inflating a layout resource.

Parameters

NameTypeDescription
contextContextThe Android context.
layoutIdintThe layout resource identifier.
parentViewGroupThe parent view group.
attachToRootboolWhether to attach the inflated view to the parent.

Remarks

This constructor is fully AOT- and trimming-safe.

No automatic control wiring is performed. Consumers are expected to wire controls explicitly.

3. Overload

protected LayoutViewHost(Context context, int layoutId, ViewGroup parent, bool attachToRoot, Action<LayoutViewHost, View> bind)

View source

Summary: Initializes a new instance of the LayoutViewHost class by inflating a layout resource and invoking an explicit, AOT-safe binder.

Parameters

NameTypeDescription
contextContextThe Android context.
layoutIdintThe layout resource identifier.
parentViewGroupThe parent view group.
attachToRootboolWhether to attach the inflated view to the parent.
bindActionA callback responsible for explicitly wiring child views to the host.

Remarks

This constructor is fully AOT-safe and avoids reflection entirely.

The bind callback is invoked only after View has been assigned.