CompositeNode
Namespace: Hex1b.Nodes
Assembly: Hex1b.dll
Base class for nodes that manage composite widgets. Composite nodes hold state and delegate rendering to their content child.
public abstract class CompositeNode : Hex1bNodeInheritance
Object → Hex1bNode → CompositeNode
Properties
ContentChild
The reconciled content child node. This is the root of the widget tree built by the composite widget.
Returns: Hex1bNode
public Hex1bNode? ContentChild { get; set; }IsFocusable
Composite nodes are NOT themselves focusable - focus passes through to children. This ensures the input router continues traversing into ContentChild to find the actual focusable node (which has the input bindings).
Returns: Boolean
public override bool IsFocusable { get; }IsFocused
Composite nodes are never themselves focused - focus state exists on the content child. The path builder should continue through GetChildren() to find the focused child.
Returns: Boolean
public override bool IsFocused { get; set; }Methods
ArrangeCore(Rect)
Arranges the content child to fill the given bounds.
Parameters:
rect(Rect):
protected override void ArrangeCore(Rect rect)GetChildren()
Returns the content child as the only child of this node. This enables focus traversal through composite widgets.
Returns: IReadOnlyList<Hex1bNode>
public override IReadOnlyList<Hex1bNode> GetChildren()GetFocusableNodes()
Returns focusable nodes from the content child. This enables the focus ring to find the actual focusable nodes inside composite widgets.
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetFocusableNodes()MeasureCore(Constraints)
Measures the content child and returns its size.
Parameters:
constraints(Constraints):
Returns: Size
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the content child.
Parameters:
context(Hex1bRenderContext):
public override void Render(Hex1bRenderContext context)Remarks
CompositeNode acts as a transparent container - it delegates measure, arrange, and render operations to its content child. Subclasses can override these methods to add additional behavior (e.g., wrapping content, handling input).
State that must survive re-renders (like popup visibility, selection index) should be stored as properties on the subclass.