Table of Contents

Class LayoutState

Namespace
SharpConsoleUI.Core
Assembly
SharpConsoleUI.dll

Complete layout state for a control, tracking requirements, allocation, and actual dimensions

public record LayoutState : IEquatable<LayoutState>
Inheritance
LayoutState
Implements
Inherited Members

Fields

Empty

Empty layout state with default requirements and no allocation.

public static readonly LayoutState Empty

Field Value

LayoutState

Properties

ActualHeight

What was actually rendered (read-only result)

public int? ActualHeight { get; init; }

Property Value

int?

ActualWidth

What was actually rendered (read-only result)

public int? ActualWidth { get; init; }

Property Value

int?

Allocation

The space allocated to the control

public LayoutAllocation Allocation { get; init; }

Property Value

LayoutAllocation

AvailableHeight

Space offered by container

public int? AvailableHeight { get; init; }

Property Value

int?

AvailableWidth

Space offered by container

public int? AvailableWidth { get; init; }

Property Value

int?

Requirements

The control's layout requirements

public LayoutRequirements Requirements { get; init; }

Property Value

LayoutRequirements

UpdateTime

When this state was last updated

public DateTime UpdateTime { get; init; }

Property Value

DateTime

Methods

HasSpaceChanged(int?, int?)

Returns true if the available space has changed from the current state

public bool HasSpaceChanged(int? newWidth, int? newHeight)

Parameters

newWidth int?
newHeight int?

Returns

bool

NeedsRerender(int?, int?)

Returns true if a re-render is needed based on the new available space

public bool NeedsRerender(int? newWidth, int? newHeight)

Parameters

newWidth int?
newHeight int?

Returns

bool