StackPanel class Core
The one geometry source of a control tree: a stack (vertical or horizontal) whose children are Fixed, Auto (their measured size) or Fill (share of the leftover). Measure and Arrange derive from the SAME child specification, so a pane's desired size and its layout can never drift apart — the successor of the per-pane y-accumulation walks that existed five times per pane.
public sealed class StackPanel : Control
- Namespace
- ArionUI.Presentation.Controls
- Package
- ArionUI.Presentation ·
dotnet add package ArionUI.Presentation --prerelease - Inherits
- Control
Constructors
StackPanel
public StackPanel();
Fields
Auto
public const double Auto = -1;Child takes its measured size along the main axis.
Fill
public const double Fill = -2;Child shares the space left after Fixed/Auto children.
Properties
Children
public override IEnumerable<Control> Children { get; }The controls inside this one, in tree order (visual order, tab order). A host keeps the tree it adopted: a control whose children change once it is adopted says so with Control.TreeChanged (on a shown board inside Board.Mutate), or its new children get no host and Tab, ticks and the wheel do not find them.
Gap
public double Gap { get; init; }Space between VISIBLE children — so a form with condition-dependent rows (the rule dialog) keeps its rhythm without per-row spacer bookkeeping.
Horizontal
public bool Horizontal { get; init; }
MainPadding
public double MainPadding { get; init; }Padding along the main axis (top+bottom of a vertical stack).
Methods
Add
public StackPanel Add(Control child, double main = -1, double cross = -1, double marginStart = 0, double marginEnd = 0);
Arrange
public override void Arrange(LogRect bounds);
HitTest
public override Control? HitTest(LogPoint p);The control under an ABSOLUTE point, or null. Containers recurse; leaves answer for themselves. Same bounds the render pass used.
Measure
public override LogSize Measure(LogSize available);Desired size given the space available (layout containers sum this).
Render
public override void Render(IRenderSurface s, ControlFrame frame);
