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
logServiceILogServiceService for debug logging.
getWindowSystemFunc<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
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
IsDirty
Gets whether any panel needs to be redrawn.
public bool IsDirty { get; }
Property Value
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
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
TopPanel
Gets the top panel (desktop bar) if configured, or null.
public Panel? TopPanel { get; }
Property Value
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
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
optionsConsoleWindowSystemOptionsThe window system configuration options.
MarkDirty()
Marks both panels as dirty, forcing a re-render on the next frame.
public void MarkDirty()