Table of Contents

Class ScrollBar

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

A scrollbar control.

[TemplatePart("PART_LineDownButton", typeof(Button))]
[TemplatePart("PART_LineUpButton", typeof(Button))]
[TemplatePart("PART_PageDownButton", typeof(Button))]
[TemplatePart("PART_PageUpButton", typeof(Button))]
[PseudoClasses(new string[] { ":vertical", ":horizontal" })]
public class ScrollBar : RangeBase, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance
ScrollBar
Implements
Inherited Members
Extension Methods

Constructors

ScrollBar()

Initializes a new instance of the ScrollBar class.

public ScrollBar()

Fields

AllowAutoHideProperty

Defines the AllowAutoHide property.

public static readonly StyledProperty<bool> AllowAutoHideProperty

Field Value

StyledProperty<bool>

HideDelayProperty

Defines the HideDelay property.

public static readonly StyledProperty<TimeSpan> HideDelayProperty

Field Value

StyledProperty<TimeSpan>

IsExpandedProperty

Defines the IsExpanded property.

public static readonly DirectProperty<ScrollBar, bool> IsExpandedProperty

Field Value

DirectProperty<ScrollBar, bool>

OrientationProperty

Defines the Orientation property.

public static readonly StyledProperty<Orientation> OrientationProperty

Field Value

StyledProperty<Orientation>

ShowDelayProperty

Defines the ShowDelay property.

public static readonly StyledProperty<TimeSpan> ShowDelayProperty

Field Value

StyledProperty<TimeSpan>

ViewportSizeProperty

Defines the ViewportSize property.

public static readonly StyledProperty<double> ViewportSizeProperty

Field Value

StyledProperty<double>

VisibilityProperty

Defines the Visibility property.

public static readonly StyledProperty<ScrollBarVisibility> VisibilityProperty

Field Value

StyledProperty<ScrollBarVisibility>

Properties

AllowAutoHide

Gets a value that indicates whether the scrollbar can hide itself when user is not interacting with it.

public bool AllowAutoHide { get; set; }

Property Value

bool

HideDelay

Gets a value that determines how long will be the hide delay after user stops interacting with the scrollbar.

public TimeSpan HideDelay { get; set; }

Property Value

TimeSpan

IsExpanded

Gets a value that indicates whether the scrollbar is expanded.

public bool IsExpanded { get; }

Property Value

bool

Orientation

Gets or sets the orientation of the scrollbar.

public Orientation Orientation { get; set; }

Property Value

Orientation

ShowDelay

Gets a value that determines how long will be the show delay when user starts interacting with the scrollbar.

public TimeSpan ShowDelay { get; set; }

Property Value

TimeSpan

ViewportSize

Gets or sets the amount of the scrollable content that is currently visible.

public double ViewportSize { get; set; }

Property Value

double

Visibility

Gets or sets a value that indicates whether the scrollbar should hide itself when it is not needed.

public ScrollBarVisibility Visibility { get; set; }

Property Value

ScrollBarVisibility

Methods

OnApplyTemplate(TemplateAppliedEventArgs)

Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.

protected override void OnApplyTemplate(TemplateAppliedEventArgs e)

Parameters

e TemplateAppliedEventArgs

The event args.

OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)

Called when the control is added to a rooted visual tree.

protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)

Parameters

e VisualTreeAttachmentEventArgs

The event args.

OnCreateAutomationPeer()

Returns a new, type-specific AutomationPeer implementation for the control.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

The type-specific AutomationPeer implementation.

OnKeyDown(KeyEventArgs)

Called before the KeyDown event occurs.

protected override void OnKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

The event args.

OnPointerEntered(PointerEventArgs)

Called before the PointerEntered event occurs.

protected override void OnPointerEntered(PointerEventArgs e)

Parameters

e PointerEventArgs

The event args.

OnPointerExited(PointerEventArgs)

Called before the PointerExited event occurs.

protected override void OnPointerExited(PointerEventArgs e)

Parameters

e PointerEventArgs

The event args.

OnPointerWheelChanged(PointerWheelEventArgs)

Called before the PointerWheelChanged event occurs.

protected override void OnPointerWheelChanged(PointerWheelEventArgs e)

Parameters

e PointerWheelEventArgs

The event args.

OnPropertyChanged(AvaloniaPropertyChangedEventArgs)

Called when a avalonia property changes on the object.

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)

Parameters

change AvaloniaPropertyChangedEventArgs

The property change details.

OnScroll(ScrollEventType)

protected void OnScroll(ScrollEventType scrollEventType)

Parameters

scrollEventType ScrollEventType

Events

Scroll

public event EventHandler<ScrollEventArgs>? Scroll

Event Type

EventHandler<ScrollEventArgs>