Table of Contents

Class PanelStateService

Namespace
SharpConsoleUI.Core
Assembly
SharpConsoleUI.dll

Manages panel state and visibility.

public class PanelStateService
Inheritance
PanelStateService
Inherited Members
Extension Methods

Constructors

PanelStateService(ILogService, Func<ConsoleWindowSystem>)

Initializes a new instance of the PanelStateService class.

public PanelStateService(ILogService logService, Func<ConsoleWindowSystem> getWindowSystem)

Parameters

logService ILogService

Service for debug logging.

getWindowSystem Func<ConsoleWindowSystem>

Function to get the window system (lazy to avoid circular dependency).

Properties

BottomPanel

Gets the bottom panel (desktop bar) if configured, or null.

public Panel? BottomPanel { get; }

Property Value

Panel

BottomStatus

Sets the text of the first StatusTextElement in the bottom panel. Convenience shorthand — equivalent to finding the element and setting .Text directly.

public string BottomStatus { set; }

Property Value

string

IsDirty

Gets whether any panel needs to be redrawn.

public bool IsDirty { get; }

Property Value

bool

ShowBottomPanel

Gets or sets whether the bottom panel is visible. Changing this affects desktop dimensions and triggers window invalidation.

public bool ShowBottomPanel { get; set; }

Property Value

bool

ShowTopPanel

Gets or sets whether the top panel is visible. Changing this affects desktop dimensions and triggers window invalidation.

public bool ShowTopPanel { get; set; }

Property Value

bool

TopPanel

Gets the top panel (desktop bar) if configured, or null.

public Panel? TopPanel { get; }

Property Value

Panel

TopStatus

Sets the text of the first StatusTextElement in the top panel. Convenience shorthand — equivalent to finding the element and setting .Text directly.

public string TopStatus { set; }

Property Value

string

Methods

InitializePanels(ConsoleWindowSystemOptions)

Initializes panels from configuration options. User-supplied config replaces the default panel entirely. When no config is provided, sensible defaults are created.

public void InitializePanels(ConsoleWindowSystemOptions options)

Parameters

options ConsoleWindowSystemOptions

The window system configuration options.

MarkDirty()

Marks both panels as dirty, forcing a re-render on the next frame.

public void MarkDirty()