ScrollController
ClassScrolls 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.LayoutAssembly:
RazorConsole.CoreDefinition
public sealed class ScrollControllerRemarks: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| Name | Type | Description |
|---|---|---|
ScrollController() | Constructor | — |
Properties
2| Name | Type | Description |
|---|---|---|
Other | ||
IsAttached | Boolean | Gets a value indicating whether a container is currently using this controller. |
Metrics | ScrollViewMetrics | Gets the current position and size; all zeros until the container has been laid out. |
Methods
5| Name | Type | Description |
|---|---|---|
ScrollByAsync(int)() | Task | Scrolls 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)() | Task | Scrolls to a row of the content; the value is limited to the scrollable range. |
ScrollToEndAsync() | Task | Scrolls to the last row. |
ScrollToStartAsync() | Task | Scrolls to the first row. |
Events
1| Name | Type | Description |
|---|---|---|
MetricsChanged | Action<ScrollViewMetrics> | Raised when the position or the size of the content or the viewport changes. |