Skip to Content
API ReferenceSingleChildElement

SingleChildElement

live Base class for elements that contain exactly one child element. Use this for wrapper elements that add behavior or styling around a single child, such as padding, alignment, or opacity.

Constructor

SingleChildElement

Creates a new single-child element with an optional key.

ParameterDescription
keyAn optional key for reconciliation identity.

Properties

Child

The single child element wrapped by this element. Must be set during object initialization.

HasChild

Returns true when Child was assigned during object initialization. Subclasses that support optional children should check this before calling GetChildren to avoid the null-child exception.

Methods

GetChildren

Returns a list containing the single child element.

Last updated on