ILogicalScrollable Interface
Definition
Interface implemented by controls that handle their own scrolling when placed inside a Avalonia.Controls.ScrollViewer.
public interface ILogicalScrollable
Remarks
Controls that implement this interface, when placed inside a Avalonia.Controls.ScrollViewer can override the physical scrolling behavior of the scroll viewer with logical scrolling. Physical scrolling means that the scroll viewer is a simple viewport onto a larger canvas whereas logical scrolling means that the scrolling is handled by the child control itself and it can choose to do handle the scroll information as it sees fit.
Methods
| Name | Description |
|---|---|
| BringIntoView | Attempts to bring a portion of the target visual into view by scrolling the content. |
| GetControlInDirection | Gets the next control in the specified direction. |
| RaiseScrollInvalidated | Raises the Avalonia.Controls.Primitives.ILogicalScrollable.ScrollInvalidated event. |
BringIntoView Method
Attempts to bring a portion of the target visual into view by scrolling the content.
public bool BringIntoView(Avalonia.Controls.Control target, Avalonia.Rect targetRect)
Parameters
target Avalonia.Controls.Control
The target visual.
targetRect Avalonia.Rect
The portion of the target visual to bring into view.
Returns
bool
True if the scroll offset was changed; otherwise false.
GetControlInDirection Method
Gets the next control in the specified direction.
public Avalonia.Controls.Control GetControlInDirection(Avalonia.Input.NavigationDirection direction, Avalonia.Controls.Control from)
Parameters
direction Avalonia.Input.NavigationDirection
The movement direction.
from Avalonia.Controls.Control
The control from which movement begins.
Returns
The control.
RaiseScrollInvalidated Method
Raises the Avalonia.Controls.Primitives.ILogicalScrollable.ScrollInvalidated event.
public void RaiseScrollInvalidated(EventArgs e)
Parameters
e EventArgs
The event args.
Properties
| Name | Description |
|---|---|
| CanHorizontallyScroll | Gets or sets a value indicating whether the content can be scrolled horizontally. |
| CanVerticallyScroll | Gets or sets a value indicating whether the content can be scrolled horizontally. |
| IsLogicalScrollEnabled | Gets a value indicating whether logical scrolling is enabled on the control. |
| PageScrollSize | Gets the size to page by, in logical units. |
| ScrollSize | Gets the size to scroll by, in logical units. |
CanHorizontallyScroll Property
Gets or sets a value indicating whether the content can be scrolled horizontally.
public bool CanHorizontallyScroll { get; set; }
CanVerticallyScroll Property
Gets or sets a value indicating whether the content can be scrolled horizontally.
public bool CanVerticallyScroll { get; set; }
IsLogicalScrollEnabled Property
Gets a value indicating whether logical scrolling is enabled on the control.
public bool IsLogicalScrollEnabled { get; set; }
PageScrollSize Property
Gets the size to page by, in logical units.
public Avalonia.Size PageScrollSize { get; set; }
ScrollSize Property
Gets the size to scroll by, in logical units.
public Avalonia.Size ScrollSize { get; set; }
Events
| Name | Description |
|---|---|
| ScrollInvalidated | Raised when the scroll is invalidated. |
ScrollInvalidated Event
Raised when the scroll is invalidated.
public event EventHandler ScrollInvalidated
Remarks
This event notifies an attached Avalonia.Controls.ScrollViewer of a change in one of the scroll properties.