Skip to content
ConsoleMonster
Class

ConsoleViewFrame

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
sealed

A content-width default view with a one-cell gutter and consistent block spacing.

Inheritance

  • object
  • ConsoleViewFrame

Usage

Explore 20 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 10

Constructors

public ConsoleViewFrame(ViewHeader header, params IWidget[] blocks) #

Creates a frame with a title line and body blocks.

Parameters

header ConsoleMonster.Widgets.ViewHeader required
blocks 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 ViewHeader Header { get; } #

The title line.

public IWidget? Headline { get; set; } #

An optional headline directly beneath the title.

public IList<IWidget> Blocks { get; } #

Body blocks separated by one blank line.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.

Extension Methods

public static ConsoleViewFrame AddBlock(ConsoleViewFrame consoleViewFrame, IWidget item) #

Adds an item to ConsoleViewFrame.Blocks: Body blocks separated by one blank line.

Parameters

consoleViewFrame ConsoleMonster.Widgets.ConsoleViewFrame required
The instance.
item ConsoleMonster.Layout.IWidget required
The item.

Returns

ConsoleViewFrame The same instance.
AddBlocks 2 overloads
public static ConsoleViewFrame AddBlocks(ConsoleViewFrame consoleViewFrame, params IWidget[] items) #

Adds items to ConsoleViewFrame.Blocks: Body blocks separated by one blank line.

Parameters

consoleViewFrame ConsoleMonster.Widgets.ConsoleViewFrame required
The instance.
items ConsoleMonster.Layout.IWidget[] required
The items, in order.

Returns

ConsoleViewFrame The same instance.
public static ConsoleViewFrame AddBlocks(ConsoleViewFrame consoleViewFrame, IEnumerable<IWidget> items) #

Adds items to ConsoleViewFrame.Blocks: Body blocks separated by one blank line.

Parameters

consoleViewFrame ConsoleMonster.Widgets.ConsoleViewFrame required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Layout.IWidget> required
The items, in order.

Returns

ConsoleViewFrame The same instance.
public static ConsoleViewFrame Header(ConsoleViewFrame consoleViewFrame, Action<ViewHeader> configure) #

Configures ConsoleViewFrame.Header in place: The title line.

Parameters

consoleViewFrame ConsoleMonster.Widgets.ConsoleViewFrame required
The instance.
configure System.Action<ConsoleMonster.Widgets.ViewHeader> required
Configures the value.

Returns

ConsoleViewFrame The same instance.
public static ConsoleViewFrame Headline(ConsoleViewFrame consoleViewFrame, IWidget? value) #

Sets ConsoleViewFrame.Headline: An optional headline directly beneath the title.

Parameters

consoleViewFrame ConsoleMonster.Widgets.ConsoleViewFrame required
The instance.
value ConsoleMonster.Layout.IWidget? required
The value.

Returns

ConsoleViewFrame The same instance.

Examples

// C# initializer or property         // C# fluent
consoleViewFrame.Headline = value;    consoleViewFrame.Headline(value);