Skip to content
ConsoleMonster
Class

AppScreen

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
sealed

One screen of an AppScreens stack: its content (which may hold inputs), the title its breadcrumb shows and the key bindings that apply while it is the current screen.

Inheritance

  • object
  • AppScreen

Usage

Explore 25 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 14

Constructors

public AppScreen(string key, string title, IWidget content) #

Creates a screen.

Parameters

key string required
The key that opens it, unique within the app.
title string required
The breadcrumb title.
content ConsoleMonster.Layout.IWidget required
The content, built once; inputs inside it keep their values while other screens show.

Properties

public string Key { get; } #

The key that opens it.

public string Title { get; set; } #

The breadcrumb title.

public Func<AppState, string>? TitleSource { get; set; } #

Builds the title from state instead, for a screen that shows one item ("web-deploy"). Runs on the app thread.

public IWidget Content { get; } #

The content.

public IList<KeyBinding> Bindings { get; } #

Keys that apply while this is the current screen. They reach the screen after the focused input and feed the footer.

Extension Methods

public static AppScreen AddBinding(AppScreen appScreen, KeyBinding item) #

Adds an item to AppScreen.Bindings: Keys that apply while this is the current screen. They reach the screen after the focused input and feed the footer.

Parameters

appScreen ConsoleMonster.Interactive.AppScreen required
The instance.
item ConsoleMonster.Interactive.KeyBinding required
The item.

Returns

AppScreen The same instance.
AddBindings 2 overloads
public static AppScreen AddBindings(AppScreen appScreen, params KeyBinding[] items) #

Adds items to AppScreen.Bindings: Keys that apply while this is the current screen. They reach the screen after the focused input and feed the footer.

Parameters

appScreen ConsoleMonster.Interactive.AppScreen required
The instance.
items ConsoleMonster.Interactive.KeyBinding[] required
The items, in order.

Returns

AppScreen The same instance.
public static AppScreen AddBindings(AppScreen appScreen, IEnumerable<KeyBinding> items) #

Adds items to AppScreen.Bindings: Keys that apply while this is the current screen. They reach the screen after the focused input and feed the footer.

Parameters

appScreen ConsoleMonster.Interactive.AppScreen required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.KeyBinding> required
The items, in order.

Returns

AppScreen The same instance.
public static AppScreen Configure(AppScreen appScreen, Action<AppScreen> configure) #

Assigns callbacks and related configuration without invoking delegate-valued properties.

Parameters

appScreen ConsoleMonster.Interactive.AppScreen required
The instance.
configure System.Action<ConsoleMonster.Interactive.AppScreen> required
Assignments applied in order.

Returns

AppScreen The same instance.

Examples

// C# initializer or property     // C# fluent
appScreen.TitleSource = value;    appScreen.Configure(configured => configured.TitleSource = value);
public static AppScreen Title(AppScreen appScreen, string value) #

Sets AppScreen.Title: The breadcrumb title.

Parameters

appScreen ConsoleMonster.Interactive.AppScreen required
The instance.
value string required
The value.

Returns

AppScreen The same instance.

Examples

// C# initializer or property    // C# fluent
appScreen.Title = value;         appScreen.Title(value);