Table of Contents

Interface IGridSource

Namespace
SharpConsoleUI.Layout
Assembly
SharpConsoleUI.dll

The seam between a grid container and the GridLayout algorithm that measures and arranges it. A grid control implements this interface to expose exactly what the layout needs: the row and column track definitions, the inter-track gaps, the grid's own margin and padding, and the ordered set of cells with their placements.

public interface IGridSource
Extension Methods

Remarks

The order of OrderedCells is significant: it must match the order in which the layout-node factory turns cells into child LayoutNodes. The layout correlates each child node to its placement by index, so node.Children[i] corresponds to OrderedCells[i].

Properties

ColumnDefinitions

Gets the column track definitions, left to right.

IReadOnlyList<GridLength> ColumnDefinitions { get; }

Property Value

IReadOnlyList<GridLength>

ColumnGap

Gets the gap, in cells, between adjacent columns.

int ColumnGap { get; }

Property Value

int

Margin

Gets the grid's own outer margin.

Margin Margin { get; }

Property Value

Margin

OrderedCells

Gets the content-bearing cells in placement order, each paired with where it sits in the grid. The IWindowControl is the same instance the layout-node factory turns into a LayoutNode, so the layout correlates node to placement by index (the order of child nodes matches the order of this list). Content-less styled cells (a background/border applied to an empty cell) are intentionally excluded so this index-correlation invariant holds; such cells affect paint chrome only, never layout-tree children.

IReadOnlyList<(IWindowControl Control, GridPlacement Placement)> OrderedCells { get; }

Property Value

IReadOnlyList<(IWindowControl Control, GridPlacement Placement)>

Padding

Gets the grid's own inner padding.

Padding Padding { get; }

Property Value

Padding

RowDefinitions

Gets the row track definitions, top to bottom.

IReadOnlyList<GridLength> RowDefinitions { get; }

Property Value

IReadOnlyList<GridLength>

RowGap

Gets the gap, in cells, between adjacent rows.

int RowGap { get; }

Property Value

int