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
Properties
CanScrollHorizontally
Gets whether horizontal scrolling is possible
public bool CanScrollHorizontally { get; }
Property Value
CanScrollVertically
Gets whether vertical scrolling is possible
public bool CanScrollVertically { get; }
Property Value
ContentHeight
Total content height
public int ContentHeight { get; init; }
Property Value
ContentWidth
Total content width
public int ContentWidth { get; init; }
Property Value
HorizontalOffset
Horizontal scroll offset (0 = left)
public int HorizontalOffset { get; init; }
Property Value
HorizontalProgress
Gets horizontal scroll progress (0.0 to 1.0)
public double HorizontalProgress { get; }
Property Value
MaxHorizontalOffset
Gets the maximum horizontal scroll offset
public int MaxHorizontalOffset { get; }
Property Value
MaxVerticalOffset
Gets the maximum vertical scroll offset
public int MaxVerticalOffset { get; }
Property Value
Position
Gets scroll position as a Point
public Point Position { get; }
Property Value
UpdateTime
Timestamp when this state was created
public DateTime UpdateTime { get; init; }
Property Value
VerticalOffset
Vertical scroll offset (0 = top)
public int VerticalOffset { get; init; }
Property Value
VerticalProgress
Gets vertical scroll progress (0.0 to 1.0)
public double VerticalProgress { get; }
Property Value
ViewportHeight
Visible viewport height
public int ViewportHeight { get; init; }
Property Value
ViewportWidth
Visible viewport width
public int ViewportWidth { get; init; }
Property Value
Methods
IsColumnVisible(int)
Returns true if the specified column is visible
public bool IsColumnVisible(int column)
Parameters
columnint
Returns
IsRowVisible(int)
Returns true if the specified row is visible
public bool IsRowVisible(int row)
Parameters
rowint