Skip to content
ConsoleMonster
Class

AppBinding

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
sealed

A display widget rebuilt from state on the application's input thread, then swapped through the live dispatcher.

Inheritance

  • object
  • AppBinding

Constructors

public AppBinding(Func<AppState, IWidget> build, string? name = null) #

Creates a dependent display view.

Parameters

build System.Func<ConsoleMonster.Interactive.AppState, ConsoleMonster.Layout.IWidget> required
Creates a fresh display widget from the current state; inputs belong in the stable outer layout.
name string? = null optional
An optional stable live-region name.

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 IReadOnlyList<IWidget> Children { get; } #

The backing live region.