Skip to content
ConsoleMonster

API Reference

Class

HeaderBar

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Implements
Modifiers sealed

The one header bar of every full-screen surface (dashboards, the Shell app, full-screen forms, runs started from a menu): a row on the Surface band with the title in SurfaceAccent, then the breadcrumb or a subtitle, and on the right a status (with its marker), free text and the elapsed clock. Without colour the band is left out and the same text is drawn plain. See Docs/Design-System.md.

Inheritance

  • Object
  • HeaderBar

Usage

Explore 36 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 18

Constructors

public HeaderBar(String title) #

Creates a header bar.

Parameters

title System.String requiredposition: 0
The title (markup).

Methods

public Size Measure(Constraints constraints, RenderContext context) #
Returns: Size

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints requiredposition: 0
The space offered.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Returns

The desired size, never larger than the constraints.

public Void Render(Region region, RenderContext context) #
Returns: Void

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The target region.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Properties

public String Title { get; set; } #

The title (markup).

public IList<String> Crumbs { get; } #

Breadcrumb steps after the title, plain text ("Tasks", "Review & run").

public String? Subtitle { get; set; } #

A subtitle after the title, separated by a dot (markup).

public String? Status { get; set; } #

Status text on the right (markup).

public StatusKind? StatusLevel { get; set; } #

The status kind; its marker goes before the status text.

public String? Right { get; set; } #

Plain text on the right, before the clock (an app's subtitle, a step count).

public Boolean ShowClock { get; set; } #

Shows the elapsed clock on the right.

public TimeSpan? Clock { get; set; } #

The clock value; null uses the render context's elapsed time.

Extension Methods

public static HeaderBar AddCrumb(HeaderBar headerBar, String item) #
Returns: HeaderBar

Adds an item to HeaderBar.Crumbs: Breadcrumb steps after the title, plain text ("Tasks", "Review & run").

Parameters

headerBar ConsoleMonster.Widgets.HeaderBar requiredposition: 0
The instance.
item System.String requiredposition: 1
The item.

Returns

The same instance.

AddCrumbs 2 overloads
public static HeaderBar AddCrumbs(HeaderBar headerBar, params String[] items) #
Returns: HeaderBar

Adds items to HeaderBar.Crumbs: Breadcrumb steps after the title, plain text ("Tasks", "Review & run").

Parameters

headerBar ConsoleMonster.Widgets.HeaderBar requiredposition: 0
The instance.
items System.String[] requiredposition: 1
The items, in order.

Returns

The same instance.

public static HeaderBar AddCrumbs(HeaderBar headerBar, IEnumerable<String> items) #
Returns: HeaderBar

Adds items to HeaderBar.Crumbs: Breadcrumb steps after the title, plain text ("Tasks", "Review & run").

Parameters

headerBar ConsoleMonster.Widgets.HeaderBar requiredposition: 0
The instance.
items System.Collections.Generic.IEnumerable<System.String> requiredposition: 1
The items, in order.

Returns

The same instance.

public static HeaderBar WithClock(HeaderBar headerBar, TimeSpan? value) #
Returns: HeaderBar

Sets HeaderBar.Clock: The clock value; null uses the render context's elapsed time.

Parameters

headerBar ConsoleMonster.Widgets.HeaderBar requiredposition: 0
The instance.
value System.TimeSpan? requiredposition: 1
The value.

Returns

The same instance.

public static HeaderBar WithRight(HeaderBar headerBar, String? value) #
Returns: HeaderBar

Sets HeaderBar.Right: Plain text on the right, before the clock (an app's subtitle, a step count).

Parameters

headerBar ConsoleMonster.Widgets.HeaderBar requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static HeaderBar WithShowClock(HeaderBar headerBar, Boolean value = true) #
Returns: HeaderBar

Sets HeaderBar.ShowClock: Shows the elapsed clock on the right.

Parameters

headerBar ConsoleMonster.Widgets.HeaderBar requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static HeaderBar WithStatus(HeaderBar headerBar, String? value) #
Returns: HeaderBar

Sets HeaderBar.Status: Status text on the right (markup).

Parameters

headerBar ConsoleMonster.Widgets.HeaderBar requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static HeaderBar WithStatusLevel(HeaderBar headerBar, StatusKind? value) #
Returns: HeaderBar

Sets HeaderBar.StatusLevel: The status kind; its marker goes before the status text.

Parameters

headerBar ConsoleMonster.Widgets.HeaderBar requiredposition: 0
The instance.
value ConsoleMonster.Styling.StatusKind? requiredposition: 1
The value.

Returns

The same instance.

public static HeaderBar WithSubtitle(HeaderBar headerBar, String? value) #
Returns: HeaderBar

Sets HeaderBar.Subtitle: A subtitle after the title, separated by a dot (markup).

Parameters

headerBar ConsoleMonster.Widgets.HeaderBar requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static HeaderBar WithTitle(HeaderBar headerBar, String value) #
Returns: HeaderBar

Sets HeaderBar.Title: The title (markup).

Parameters

headerBar ConsoleMonster.Widgets.HeaderBar requiredposition: 0
The instance.
value System.String requiredposition: 1
The value.

Returns

The same instance.