Skip to content
ConsoleMonster
Class

Stack

ConsoleMonster.Layout

Namespace
ConsoleMonster.Layout
Assembly
ConsoleMonster
Implements
IContainer IWidget IContentOwner
Modifiers
sealed

Layers children on top of each other in the same region, in order: later layers paint over earlier ones. A layer replaces only the cells it writes, so the layers below stay visible around it. Combine with Align to place an overlay, for example a status badge in the top-right corner of a chart. For children placed one below another, use Rows.

Inheritance

  • object
  • Stack

Usage

Explore 7 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 3

Accepted by parameters 4

Constructors

public Stack(params IWidget[] layers) #

Creates a stack.

Parameters

layers ConsoleMonster.Layout.IWidget[] required
The layers, bottom first.

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 child widgets in layout order.

Extension Methods

Content 2 overloads
public static Stack Content(Stack stack, IWidget content) #

Configures this container's content before session ownership.

Parameters

stack ConsoleMonster.Layout.Stack required
The instance.
content ConsoleMonster.Layout.IWidget required
The widget or nested content builder.

Returns

Stack The same instance.
public static Stack Content(Stack stack, Action<ContentBuilder> content) #

Configures this container's content before session ownership.

Parameters

stack ConsoleMonster.Layout.Stack required
The instance.
content System.Action<ConsoleMonster.Layout.ContentBuilder> required
The widget or nested content builder.

Returns

Stack The same instance.