ScrollController

Class

Scrolls a container from code. Pass an instance to the Controller parameter of a scroll container (a Box, Panel, Padder or Border with Overflow="OverflowMode.Scroll").

Namespace: RazorConsole.Core.Layout
Assembly: RazorConsole.Core

Definition

public sealed class ScrollController
Remarks:A controller drives one container at a time and does nothing until that container has rendered. Scrolling happens in the layout engine and repaints without a Blazor render. MetricsChanged can be raised on any thread.

Constructors

1
NameTypeDescription
ScrollController()Constructor—

Properties

2
NameTypeDescription
Other
IsAttachedBooleanGets a value indicating whether a container is currently using this controller.
MetricsScrollViewMetricsGets the current position and size; all zeros until the container has been laid out.

Methods

5
NameTypeDescription
ScrollByAsync(int)()TaskScrolls by a number of rows; negative values scroll up.
ScrollIntoViewAsync(string)()Task<Boolean>Scrolls the container so that an element inside it is visible.
ScrollToAsync(int)()TaskScrolls to a row of the content; the value is limited to the scrollable range.
ScrollToEndAsync()TaskScrolls to the last row.
ScrollToStartAsync()TaskScrolls to the first row.

Events

1
NameTypeDescription
MetricsChangedAction<ScrollViewMetrics>Raised when the position or the size of the content or the viewport changes.