Columns
ConsoleMonster.Layout
Places children side by side. Children in a row share their height, so panels line up instead of forming a staircase. When the width drops below the children's minimum widths the columns stack vertically instead of squeezing content unreadably.
Inheritance
- object
- Columns
Usage
Explore 16 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.
Returned or exposed by 8
- Extension method Columns.CollapseBelow
- Extension method Columns.Content
- Extension method Columns.Gap
- Method Columns.Add
- Method ColumnsFluent.CollapseBelow
- Method ColumnsFluent.Content
- Method ColumnsFluent.Gap
- Method Ui.Columns
Accepted by parameters 8
- Extension method Columns.CollapseBelow
- Extension method Columns.Content
- Extension method Columns.Gap
- Method ColumnsFluent.CollapseBelow
- Method ColumnsFluent.Content
- Method ColumnsFluent.Gap
- Method ContentBuilder.Columns
- Method ContentBuilder.Columns
Constructors
public Columns(params IWidget[] children) #Creates columns that share the width equally.
Parameters
- children ConsoleMonster.Layout.IWidget[]
- The children.
Methods
public Columns Add(IWidget child, LayoutSize? size = null) #Adds a child.
Parameters
- child ConsoleMonster.Layout.IWidget
- The child.
- size ConsoleMonster.Layout.LayoutSize? = null
- Its width specification (default one equal fraction).
public Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public void Render(Region region, RenderContext context) #Renders 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
Properties
public int CollapseBelow { get; set; } #Width below which the columns stack vertically. -1 (default) uses the sum of the children's minimum widths (fractions without a minimum count as 16 cells).
public IReadOnlyList<LayoutSize> Sizes { get; } #Size specifications, parallel to Columns.Children.
Extension Methods
public static Columns CollapseBelow(Columns columns, int value) #Sets Columns.CollapseBelow: Width below which the columns stack vertically. -1 (default) uses the sum of the children's minimum widths (fractions without a minimum count as 16 cells).
Parameters
- columns ConsoleMonster.Layout.Columns
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
columns.CollapseBelow = value; Ui.Columns().CollapseBelow(value);public static Columns Content(Columns columns, IWidget content) #Configures this container's content before session ownership.
Parameters
- columns ConsoleMonster.Layout.Columns
- The instance.
- content ConsoleMonster.Layout.IWidget
- The widget or nested content builder.
public static Columns Content(Columns columns, Action<ContentBuilder> content) #Configures this container's content before session ownership.
Parameters
- columns ConsoleMonster.Layout.Columns
- The instance.
- content System.Action<ConsoleMonster.Layout.ContentBuilder>
- The widget or nested content builder.
public static Columns Gap(Columns columns, int value) #Sets Columns.Gap: Blank columns between children (default 1).
Parameters
- columns ConsoleMonster.Layout.Columns
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
columns.Gap = value; Ui.Columns().Gap(value);