Skip to content
ConsoleMonster
Class

LayoutRegion

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
sealed

A named, swappable layout slot. Keep its inputs stable for the lifetime of an app.

Inheritance

  • object
  • LayoutRegion

Usage

Explore 6 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 4

Accepted by parameters 2

Constructors

public LayoutRegion(string key, IWidget content) #

Creates a named slot.

Parameters

key string required
content ConsoleMonster.Layout.IWidget required

Methods

public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
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 required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Properties

public string Key { get; } #

The region identity.

public IWidget Content { get; set; } #

The current subtree. Swap existing subtrees while an app runs; configure new inputs before starting.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.

Extension Methods

public static LayoutRegion Content(LayoutRegion layoutRegion, IWidget value) #

Sets LayoutRegion.Content: The current subtree. Swap existing subtrees while an app runs; configure new inputs before starting.

Parameters

layoutRegion ConsoleMonster.Widgets.LayoutRegion required
The instance.
value ConsoleMonster.Layout.IWidget required
The value.

Returns

LayoutRegion The same instance.

Examples

// C# initializer or property    // C# fluent
layoutRegion.Content = value;    layoutRegion.Content(value);