Struct FlowChrome
- Namespace
- SharpConsoleUI.Flows
- Assembly
- SharpConsoleUI.dll
Chrome hints supplied to a flow step when building its content. The host uses these to size and decorate the host window; the content may read them to size its own body.
public readonly struct FlowChrome
- Inherited Members
- Extension Methods
Constructors
FlowChrome(string, (int Index, int? Count)?, int?, int?, IReadOnlyList<FlowButton>?, Func<IReadOnlyList<FlowButton>>?, NotificationSeverityEnum, bool, bool)
Initialises a FlowChrome value.
public FlowChrome(string title, (int Index, int? Count)? stepIndicator = null, int? widthHint = null, int? heightHint = null, IReadOnlyList<FlowButton>? buttons = null, Func<IReadOnlyList<FlowButton>>? refreshButtons = null, NotificationSeverityEnum severity = NotificationSeverityEnum.None, bool autoSizeHeight = false, bool resizable = false)
Parameters
titlestringThe window or dialog title.
stepIndicator(int Index, int? Count)?Optional step-position indicator, e.g.
(2, 4)for "step 2 of 4".widthHintint?Optional preferred width of the host window in columns.
heightHintint?Optional preferred height of the host window in rows.
buttonsIReadOnlyList<FlowButton>The concrete button list to render. When
nullor omitted an empty list is used; the host typically populates this from the chosen FlowButtons set.refreshButtonsFunc<IReadOnlyList<FlowButton>>Optional delegate the host calls on each StateChanged to re-evaluate the button row's enabled state in place (dynamic buttons). When
nullthe host leaves the button enabled state unchanged on state changes. Supplied by the wizard; primitives and Tier-A leave itnull.severityNotificationSeverityEnumOptional severity that controls the host-built top band's glyph and accent-rule colour role. The host always builds the top band; None (the default) renders a glyph-less bold title on a Primary rule, while Info/Success/Warning/Danger render the matching severity glyph and rule role. Additive trailing parameter — existing FlowChrome construction is unaffected.
autoSizeHeightboolWhen
trueand HeightHint is null, the host auto-sizes the window height to the content (clamped to a min floor and a terminal-derived cap; it scrolls beyond the cap). An explicit HeightHint always overrides this. Defaultfalse.resizableboolWhen
true, the host lets the user drag-resize the window (minimize/maximize buttons stay disabled). Independent of AutoSizeHeight: the initial height is chosen by the normal rule, and this only allows manual resize afterward. Defaultfalse.
Properties
AutoSizeHeight
When true and HeightHint is null, the host auto-sizes the window
height to the content (clamped to a min floor and a terminal-derived cap; it scrolls beyond the
cap). An explicit HeightHint always overrides this. Default false.
public bool AutoSizeHeight { get; }
Property Value
Buttons
The standardized button row to render. Built by the host from the chosen FlowButtons set plus any per-step label or enable overrides. Defaults to an empty list when not provided.
public IReadOnlyList<FlowButton> Buttons { get; }
Property Value
HeightHint
Optional preferred height of the host window in terminal rows.
public int? HeightHint { get; }
Property Value
- int?
RefreshButtons
Optional delegate invoked by the host on each StateChanged
to re-compute the button row's enabled state in place (dynamic buttons). Returns the refreshed
button list (same labels/verdicts, updated Enabled); the host applies
each enabled flag to the live button without rebuilding the window. null means no
dynamic re-evaluation. Supplied by the wizard (Tier B); null for primitives/Tier A.
public Func<IReadOnlyList<FlowButton>>? RefreshButtons { get; }
Property Value
Resizable
When true, the host lets the user drag-resize the window (minimize/maximize
buttons stay disabled). Independent of AutoSizeHeight: the initial height is chosen
by the normal rule, and this only allows manual resize afterward. Default false.
public bool Resizable { get; }
Property Value
Severity
The severity that drives the host-built top band's glyph and accent-rule colour role. None (the default) renders the bold title with no glyph on a Primary rule; Info/Success/Warning/Danger render the matching glyph and rule role. The host always builds the top band from this value, so primitives, plain custom content, and wizard steps all show a consistent title band.
public NotificationSeverityEnum Severity { get; }
Property Value
StepIndicator
Optional step position, e.g. (Index: 2, Count: 4).
Count may be null for flows with a dynamic or unknown number of steps.
public (int Index, int? Count)? StepIndicator { get; }
Property Value
Title
The window or dialog title text.
public string Title { get; }
Property Value
WidthHint
Optional preferred width of the host window in terminal columns.
public int? WidthHint { get; }
Property Value
- int?