Table of Contents

Class ScrollState

Namespace
SharpConsoleUI.Core
Assembly
SharpConsoleUI.dll

Immutable record representing scroll state for a scrollable element

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

Constructors

ScrollState()

Creates a new scroll state

public ScrollState()

Fields

Empty

Empty scroll state (at origin)

public static readonly ScrollState Empty

Field Value

ScrollState

Properties

CanScrollHorizontally

Gets whether horizontal scrolling is possible

public bool CanScrollHorizontally { get; }

Property Value

bool

CanScrollVertically

Gets whether vertical scrolling is possible

public bool CanScrollVertically { get; }

Property Value

bool

ContentHeight

Total content height

public int ContentHeight { get; init; }

Property Value

int

ContentWidth

Total content width

public int ContentWidth { get; init; }

Property Value

int

HorizontalOffset

Horizontal scroll offset (0 = left)

public int HorizontalOffset { get; init; }

Property Value

int

HorizontalProgress

Gets horizontal scroll progress (0.0 to 1.0)

public double HorizontalProgress { get; }

Property Value

double

MaxHorizontalOffset

Gets the maximum horizontal scroll offset

public int MaxHorizontalOffset { get; }

Property Value

int

MaxVerticalOffset

Gets the maximum vertical scroll offset

public int MaxVerticalOffset { get; }

Property Value

int

Position

Gets scroll position as a Point

public Point Position { get; }

Property Value

Point

UpdateTime

Timestamp when this state was created

public DateTime UpdateTime { get; init; }

Property Value

DateTime

VerticalOffset

Vertical scroll offset (0 = top)

public int VerticalOffset { get; init; }

Property Value

int

VerticalProgress

Gets vertical scroll progress (0.0 to 1.0)

public double VerticalProgress { get; }

Property Value

double

ViewportHeight

Visible viewport height

public int ViewportHeight { get; init; }

Property Value

int

ViewportWidth

Visible viewport width

public int ViewportWidth { get; init; }

Property Value

int

Methods

IsColumnVisible(int)

Returns true if the specified column is visible

public bool IsColumnVisible(int column)

Parameters

column int

Returns

bool

IsRowVisible(int)

Returns true if the specified row is visible

public bool IsRowVisible(int row)

Parameters

row int

Returns

bool