Table of Contents

Interface IContainer

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

Represents a container that can host window controls and provides shared properties for rendering.

public interface IContainer
Extension Methods

Properties

BackgroundColor

Gets or sets the background color for the container and its child controls.

Color BackgroundColor { get; set; }

Property Value

Color

ForegroundColor

Gets or sets the foreground (text) color for the container and its child controls.

Color ForegroundColor { get; set; }

Property Value

Color

GetConsoleWindowSystem

Gets the console window system instance, or null if not attached to a window system.

ConsoleWindowSystem? GetConsoleWindowSystem { get; }

Property Value

ConsoleWindowSystem

Methods

GetVisibleHeightForControl(IWindowControl)

Gets the actual visible height for a control within the container viewport. Returns null if the control is not found or visibility cannot be determined.

int? GetVisibleHeightForControl(IWindowControl control)

Parameters

control IWindowControl

The control to check

Returns

int?

The number of visible lines, or null if unknown

Invalidate(Invalidation, IWindowControl?)

Marks this container as needing the specified work on the next frame. The request propagates up the container chain and folds into the owning window's frame-intent accumulator.

void Invalidate(Invalidation work, IWindowControl? callerControl = null)

Parameters

work Invalidation

The kind of work requested: Repaint (appearance-only, Measure skipped) or Relayout (full layout).

callerControl IWindowControl

The control that triggered the invalidation, if any (cycle guard).

Invalidate(bool, IWindowControl?)

Marks this container as needing work on the next frame. Compatibility overload preserving the previous boolean signature: true maps to Relayout, false to Repaint.

void Invalidate(bool redrawAll, IWindowControl? callerControl = null)

Parameters

redrawAll bool

true for a full re-layout, false for an appearance-only repaint.

callerControl IWindowControl

The control that triggered the invalidation, if any (cycle guard).