API Reference
Grid (Layout)
Lays children out in equal-width columns, row by row. Cells in a row share the row height. When columns would become narrower than Grid.MinColumnWidth, the grid uses fewer columns. In a live frame with spare height, rows grow equally so the grid fills its region.
Inheritance
- Object
- Grid
Usage
Explore 8 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Accepted by parameters 8
- Extension method Grid.WithColumnGap
- Extension method Grid.WithFillHeight
- Extension method Grid.WithMinColumnWidth
- Extension method Grid.WithRowGap
- Method GridFluent.WithColumnGap
- Method GridFluent.WithFillHeight
- Method GridFluent.WithMinColumnWidth
- Method GridFluent.WithRowGap
Constructors
public Grid(Int32 columns, params IWidget[] children) #Creates a grid.
Parameters
- columns System.Int32
- Number of columns (at least 1).
- children ConsoleMonster.Layout.IWidget[]
- Initial children.
Methods
public Grid Add(IWidget child) #GridAdds a cell.
Parameters
- child ConsoleMonster.Layout.IWidget
- The child.
Returns
This instance.
public Size Measure(Constraints constraints, RenderContext context) #SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public Void Render(Region region, RenderContext context) #VoidRenders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
Extension Methods
public static Grid WithColumnGap(Grid grid, Int32 value) #GridSets Grid.ColumnGap: Blank columns between cells (default 1).
Parameters
- grid ConsoleMonster.Layout.Grid
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static Grid WithFillHeight(Grid grid, Boolean value = true) #GridSets Grid.FillHeight: Whether rows grow to fill spare height in a bounded region (default true).
Parameters
- grid ConsoleMonster.Layout.Grid
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static Grid WithMinColumnWidth(Grid grid, Int32 value) #GridSets Grid.MinColumnWidth: The narrowest column before the grid reduces its column count (default 24).
Parameters
- grid ConsoleMonster.Layout.Grid
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static Grid WithRowGap(Grid grid, Int32 value) #GridSets Grid.RowGap: Blank rows between grid rows (default 0).
Parameters
- grid ConsoleMonster.Layout.Grid
- The instance.
- value System.Int32
- The value.
Returns
The same instance.