Table of Contents

Class CollapsiblePanelBuilder

Namespace
SharpConsoleUI.Builders
Assembly
SharpConsoleUI.dll

Fluent builder for creating CollapsiblePanel instances.

public sealed class CollapsiblePanelBuilder : IControlBuilder<CollapsiblePanel>
Inheritance
CollapsiblePanelBuilder
Implements
Inherited Members
Extension Methods

Methods

AddControl(IWindowControl)

Adds a child control to the panel body.

public CollapsiblePanelBuilder AddControl(IWindowControl control)

Parameters

control IWindowControl

Returns

CollapsiblePanelBuilder

Animated()

Enables height-based expand/collapse animation.

public CollapsiblePanelBuilder Animated()

Returns

CollapsiblePanelBuilder

Bordered()

Renders the header as a bordered box (title embedded in the top border).

public CollapsiblePanelBuilder Bordered()

Returns

CollapsiblePanelBuilder

Build()

Builds the configured CollapsiblePanel.

public CollapsiblePanel Build()

Returns

CollapsiblePanel

Collapsed()

Starts the panel in the collapsed state.

public CollapsiblePanelBuilder Collapsed()

Returns

CollapsiblePanelBuilder

Collapsible(bool)

Controls whether the panel can be collapsed/expanded by the user (default true).

public CollapsiblePanelBuilder Collapsible(bool collapsible = true)

Parameters

collapsible bool

Returns

CollapsiblePanelBuilder

Expanded()

Starts the panel in the expanded state.

public CollapsiblePanelBuilder Expanded()

Returns

CollapsiblePanelBuilder

HideHeader()

Hides the header row. A collapsible panel always shows its header regardless.

public CollapsiblePanelBuilder HideHeader()

Returns

CollapsiblePanelBuilder

NonCollapsible()

Makes the panel a plain, non-collapsible container (locked expanded, pass-through focus).

public CollapsiblePanelBuilder NonCollapsible()

Returns

CollapsiblePanelBuilder

OnExpandedChanged(EventHandler<bool>)

Subscribes a handler to the ExpandedChanged event.

public CollapsiblePanelBuilder OnExpandedChanged(EventHandler<bool> handler)

Parameters

handler EventHandler<bool>

Returns

CollapsiblePanelBuilder

Outline(bool)

Renders the panel in outline style (lighter role chrome).

public CollapsiblePanelBuilder Outline(bool outline = true)

Parameters

outline bool

Whether to use outline style.

Returns

CollapsiblePanelBuilder

Rounded()

Renders the header as a bordered box with rounded corners (╭╮╰╯).

public CollapsiblePanelBuilder Rounded()

Returns

CollapsiblePanelBuilder

ShowHeader(bool)

Controls whether the header row is drawn (default true).

public CollapsiblePanelBuilder ShowHeader(bool show = true)

Parameters

show bool

Returns

CollapsiblePanelBuilder

Visible(bool)

Sets the visibility

public CollapsiblePanelBuilder Visible(bool visible = true)

Parameters

visible bool

Whether the panel is visible

Returns

CollapsiblePanelBuilder

The builder for chaining

WithAnimation(CollapsibleAnimationMode)

Sets how expand/collapse transitions are animated.

public CollapsiblePanelBuilder WithAnimation(CollapsibleAnimationMode mode)

Parameters

mode CollapsibleAnimationMode

Returns

CollapsiblePanelBuilder

WithBackgroundColor(Color)

Sets the background color.

public CollapsiblePanelBuilder WithBackgroundColor(Color color)

Parameters

color Color

Returns

CollapsiblePanelBuilder

WithBorderColor(Color)

Sets the border color.

public CollapsiblePanelBuilder WithBorderColor(Color color)

Parameters

color Color

Returns

CollapsiblePanelBuilder

WithCollapsedIcon(string)

Sets the indicator icon shown when the panel is collapsed.

public CollapsiblePanelBuilder WithCollapsedIcon(string icon)

Parameters

icon string

Returns

CollapsiblePanelBuilder

WithColorRole(ColorRole, ThemeMode?)

Sets the control's semantic colour role, which tints the panel border/header chrome.

public CollapsiblePanelBuilder WithColorRole(ColorRole role, ThemeMode? mode = null)

Parameters

role ColorRole

The semantic role determining the panel's chrome colour.

mode ThemeMode?

Optional ThemeMode override for dark/light role-colour derivation. When null, the active theme's mode is used.

Returns

CollapsiblePanelBuilder

WithExpandedIcon(string)

Sets the indicator icon shown when the panel is expanded.

public CollapsiblePanelBuilder WithExpandedIcon(string icon)

Parameters

icon string

Returns

CollapsiblePanelBuilder

WithFocusedBackgroundColor(Color)

Sets the header background color used when the panel has keyboard focus.

public CollapsiblePanelBuilder WithFocusedBackgroundColor(Color color)

Parameters

color Color

Returns

CollapsiblePanelBuilder

WithFocusedColors(Color, Color)

Sets both the header foreground and background colors used when the panel has keyboard focus.

public CollapsiblePanelBuilder WithFocusedColors(Color foreground, Color background)

Parameters

foreground Color
background Color

Returns

CollapsiblePanelBuilder

WithFocusedForegroundColor(Color)

Sets the header foreground color used when the panel has keyboard focus.

public CollapsiblePanelBuilder WithFocusedForegroundColor(Color color)

Parameters

color Color

Returns

CollapsiblePanelBuilder

WithForegroundColor(Color)

Sets the foreground color.

public CollapsiblePanelBuilder WithForegroundColor(Color color)

Parameters

color Color

Returns

CollapsiblePanelBuilder

WithHeaderAlignment(HorizontalAlignment)

Sets the horizontal alignment of the header content.

public CollapsiblePanelBuilder WithHeaderAlignment(HorizontalAlignment alignment)

Parameters

alignment HorizontalAlignment

Returns

CollapsiblePanelBuilder

WithHeaderSeparator(bool)

Controls whether a separator is drawn under the header.

public CollapsiblePanelBuilder WithHeaderSeparator(bool show = true)

Parameters

show bool

Returns

CollapsiblePanelBuilder

WithHeaderStyle(CollapsibleHeaderStyle)

Sets the visual style used to render the header.

public CollapsiblePanelBuilder WithHeaderStyle(CollapsibleHeaderStyle style)

Parameters

style CollapsibleHeaderStyle

Returns

CollapsiblePanelBuilder

WithIcons(string, string)

Sets both the expanded and collapsed indicator icons.

public CollapsiblePanelBuilder WithIcons(string expanded, string collapsed)

Parameters

expanded string
collapsed string

Returns

CollapsiblePanelBuilder

WithMargin(Margin)

Sets the panel margin.

public CollapsiblePanelBuilder WithMargin(Margin margin)

Parameters

margin Margin

Returns

CollapsiblePanelBuilder

WithMargin(int)

Sets a uniform margin on all sides.

public CollapsiblePanelBuilder WithMargin(int margin)

Parameters

margin int

Returns

CollapsiblePanelBuilder

WithMargin(int, int, int, int)

Sets the panel margin (left, top, right, bottom).

public CollapsiblePanelBuilder WithMargin(int left, int top, int right, int bottom)

Parameters

left int
top int
right int
bottom int

Returns

CollapsiblePanelBuilder

WithMaxContentHeight(int)

Caps the visible body height to the specified number of rows.

public CollapsiblePanelBuilder WithMaxContentHeight(int rows)

Parameters

rows int

Returns

CollapsiblePanelBuilder

WithName(string)

Sets the control name for FindControl queries.

public CollapsiblePanelBuilder WithName(string name)

Parameters

name string

Returns

CollapsiblePanelBuilder

WithTitle(string)

Sets the header title text.

public CollapsiblePanelBuilder WithTitle(string title)

Parameters

title string

Returns

CollapsiblePanelBuilder

WithWidth(int)

Sets the fixed width of the panel.

public CollapsiblePanelBuilder WithWidth(int width)

Parameters

width int

Returns

CollapsiblePanelBuilder

Operators

implicit operator CollapsiblePanel(CollapsiblePanelBuilder)

Implicit conversion to CollapsiblePanel.

public static implicit operator CollapsiblePanel(CollapsiblePanelBuilder builder)

Parameters

builder CollapsiblePanelBuilder

Returns

CollapsiblePanel