Skip to main content

ILogicalScrollable Interface

Definition

Assembly:Avalonia.Controls
Package:Avalonia

Interface implemented by controls that handle their own scrolling when placed inside a Avalonia.Controls.ScrollViewer.

public interface ILogicalScrollable
Implements:IScrollable

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

NameDescription
BringIntoViewAttempts to bring a portion of the target visual into view by scrolling the content.
GetControlInDirectionGets the next control in the specified direction.
RaiseScrollInvalidatedRaises 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

Avalonia.Controls.Control

The control.

RaiseScrollInvalidated Method

Raises the Avalonia.Controls.Primitives.ILogicalScrollable.ScrollInvalidated event.

public void RaiseScrollInvalidated(EventArgs e)

Parameters

e EventArgs

The event args.

Properties

NameDescription
CanHorizontallyScrollGets or sets a value indicating whether the content can be scrolled horizontally.
CanVerticallyScrollGets or sets a value indicating whether the content can be scrolled horizontally.
IsLogicalScrollEnabledGets a value indicating whether logical scrolling is enabled on the control.
PageScrollSizeGets the size to page by, in logical units.
ScrollSizeGets 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

NameDescription
ScrollInvalidatedRaised 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.