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

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

IsDirty

Gets or sets whether this container needs to be redrawn.

bool IsDirty { get; set; }

Property Value

bool

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(bool, IWindowControl?)

Marks this container as needing to be redrawn.

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

Parameters

redrawAll bool

If true, forces a complete redraw of all content.

callerControl IWindowControl

The control that triggered the invalidation, if any.