Skip to main content

ScrollViewer Class

NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Controls

A container that lets a single child be scrolled horizontally and vertically within a smaller viewport.

public class ScrollViewer : ContentControl

Constructors

ScrollViewer()

public ScrollViewer()

Initializes a new instance of the ScrollViewer class.

Properties

HorizontalOffset

public int HorizontalOffset { get; set; }

The current horizontal scroll offset, clamped to the scrollable range.

VerticalOffset

public int VerticalOffset { get; set; }

The current vertical scroll offset, clamped to the scrollable range.

ExtentHeight

public int ExtentHeight { get; }

The full height of the scrollable content.

ExtentWidth

public int ExtentWidth { get; }

The full width of the scrollable content.

LineWidth

public int LineWidth { get; set; }

The horizontal distance scrolled by one line step.

LineHeight

public int LineHeight { get; set; }

The vertical distance scrolled by one line step.

ScrollingStyle

public ScrollingStyle ScrollingStyle { get; set; }

Whether hardware-button scrolling advances by line or by page.

Methods

MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)

protected override void MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)

Measures the child against the viewer's alignment and records its extent.

ArrangeOverride(int arrangeWidth, int arrangeHeight)

protected override void ArrangeOverride(int arrangeWidth, int arrangeHeight)

Positions the child according to the current scroll offsets.

LineDown()

public void LineDown()

Scrolls down by one line.

LineLeft()

public void LineLeft()

Scrolls left by one line.

LineRight()

public void LineRight()

Scrolls right by one line.

LineUp()

public void LineUp()

Scrolls up by one line.

PageDown()

public void PageDown()

Scrolls down by one page (the viewport height).

PageLeft()

public void PageLeft()

Scrolls left by one page (the viewport width).

public void PageRight()

Scrolls right by one page (the viewport width).

PageUp()

public void PageUp()

Scrolls up by one page (the viewport height).

OnButtonDown(GHIElectronics.TinyCLR.UI.Input.ButtonEventArgs e)

protected override void OnButtonDown(GHIElectronics.TinyCLR.UI.Input.ButtonEventArgs e)

Handles directional hardware buttons by scrolling by line or page.

Events

ScrollChanged

public event ScrollChangedEventHandler ScrollChanged

Raised when the scroll offset changes.