Table of Contents

Class SeparatorControl

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

A simple vertical separator control for visually dividing UI elements. Unlike SplitterControl, this is non-interactive and non-focusable. Uses a single vertical line character for a subtle appearance.

public class SeparatorControl : BaseControl, IWindowControl, IDisposable, IDOMPaintable, INotifyPropertyChanged
Inheritance
SeparatorControl
Implements
Inherited Members
Extension Methods

Constructors

SeparatorControl()

Initializes a new instance of the SeparatorControl class.

public SeparatorControl()

Properties

BackgroundColor

Gets or sets the background color of the separator. When null, inherits from the container.

public Color? BackgroundColor { get; set; }

Property Value

Color?

Character

Gets or sets the character used to draw the separator. Defaults to '│' (single vertical line).

public char Character { get; set; }

Property Value

char

Container

Gets or sets the parent container that hosts this control.

public override IContainer? Container { get; set; }

Property Value

IContainer

ContentWidth

Gets the minimum width needed to display the control's content, including margins. Returns null if width cannot be determined. This is calculated based on content (text length, child controls, etc.) and represents the natural/intrinsic size.

public override int? ContentWidth { get; }

Property Value

int?

ForegroundColor

Gets or sets the foreground color of the separator. When null, uses theme's SeparatorForegroundColor, then falls back to container color.

public Color? ForegroundColor { get; set; }

Property Value

Color?

Width

Gets or sets the explicit width of the control, or null for automatic sizing.

public override int? Width { get; set; }

Property Value

int?

Methods

GetLogicalContentSize()

Gets the logical size of the control's content without rendering.

public override Size GetLogicalContentSize()

Returns

Size

The size representing the content's natural dimensions.

MeasureDOM(LayoutConstraints)

Measures the control's desired size given the available constraints.

public override LayoutSize MeasureDOM(LayoutConstraints constraints)

Parameters

constraints LayoutConstraints

The layout constraints (min/max width/height).

Returns

LayoutSize

The desired size of the control.

PaintDOM(CharacterBuffer, LayoutRect, LayoutRect, Color, Color)

Paints the control's content directly to a CharacterBuffer.

public override void PaintDOM(CharacterBuffer buffer, LayoutRect bounds, LayoutRect clipRect, Color defaultFg, Color defaultBg)

Parameters

buffer CharacterBuffer

The buffer to paint to.

bounds LayoutRect

The absolute bounds where the control should paint.

clipRect LayoutRect

The clipping rectangle (visible area).

defaultFg Color
defaultBg Color