The stack layout is represented by the NStackLayout class. The stack layout is a directed cells layout, which stacks the cells in the direction specified by the Direction property. The stack layout is constrained by the size of the layout area in the current cells direction (e.g. for a top-to-bottom direction the layout is constrained by height).
The stack layout tries to place cells one after the other at their desired size, spaced by the values specified by the HorizontalSpacing or VerticalSpacing properties. For a vertically oriented direction the layout uses only the vertical spacing, while for a horizontally oriented direction the layout uses only the horizontal spacing.
In respect to the constraining dimension (i.e. height for a vertically oriented stack, width for a horizontally oriented stack), the stacking can either occupy more or less space than available.
In case the ordinary stacking occupies less space you can instruct the stack layout to inflate the cells in order to fill the available space. This is specified by the FillMode property, which takes a value from the StackMode enumeration.
In the other case when ordinary stacking occupies more space you can instruct the stack layout to deflate the cells in order to fit the available space. This is specified by the FitMode property, which takes a value from the StackMode enumeration.
Both the filling and fitting take into account the per-cell specified MinSize and MaxSize constrains (only in the respective direction), which means that both filling and fitting may not always ensure that the available space is fully occupied, because this may break a MinSize or MaxSize constraint.