Table of Contents

Interface ILogicalScrollable

Namespace
Avalonia.Controls.Primitives
Assembly
Avalonia.Controls.dll

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

public interface ILogicalScrollable : IScrollable
Inherited Members

Remarks

Controls that implement this interface, when placed inside a 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.

Properties

CanHorizontallyScroll

Gets or sets a value indicating whether the content can be scrolled horizontally.

bool CanHorizontallyScroll { get; set; }

Property Value

bool

CanVerticallyScroll

Gets or sets a value indicating whether the content can be scrolled horizontally.

bool CanVerticallyScroll { get; set; }

Property Value

bool

IsLogicalScrollEnabled

Gets a value indicating whether logical scrolling is enabled on the control.

bool IsLogicalScrollEnabled { get; }

Property Value

bool

PageScrollSize

Gets the size to page by, in logical units.

Size PageScrollSize { get; }

Property Value

Size

ScrollSize

Gets the size to scroll by, in logical units.

Size ScrollSize { get; }

Property Value

Size

Methods

BringIntoView(Control, Rect)

Attempts to bring a portion of the target visual into view by scrolling the content.

bool BringIntoView(Control target, Rect targetRect)

Parameters

target Control

The target visual.

targetRect Rect

The portion of the target visual to bring into view.

Returns

bool

True if the scroll offset was changed; otherwise false.

GetControlInDirection(NavigationDirection, Control?)

Gets the next control in the specified direction.

Control? GetControlInDirection(NavigationDirection direction, Control? from)

Parameters

direction NavigationDirection

The movement direction.

from Control

The control from which movement begins.

Returns

Control

The control.

RaiseScrollInvalidated(EventArgs)

Raises the ScrollInvalidated event.

void RaiseScrollInvalidated(EventArgs e)

Parameters

e EventArgs

The event args.

Events

ScrollInvalidated

Raised when the scroll is invalidated.

event EventHandler? ScrollInvalidated

Event Type

EventHandler

Remarks

This event notifies an attached ScrollViewer of a change in one of the scroll properties.