ScrollViewer Class

A control which scrolls its content if the content is bigger than the space available.

Definition

Namespace: Avalonia.Controls
Assembly: Avalonia.Controls (in Avalonia.Controls.dll) Version: 11.3.999
[TemplatePartAttribute("PART_HorizontalScrollBar", typeof(ScrollBar))]
[TemplatePartAttribute("PART_VerticalScrollBar", typeof(ScrollBar))]
public class ScrollViewer : ContentControl, 
	IScrollable, IScrollAnchorProvider
Inheritance
Object    AvaloniaObject    Animatable    StyledElement    Visual    Layoutable    Interactive    InputElement    Control    TemplatedControl    ContentControl    ScrollViewer
Implements
IScrollAnchorProvider, IScrollable

Constructors

ScrollViewer Initializes a new instance of the ScrollViewer class.

Properties

ActualThemeVariant
(Inherited from StyledElement)
AllowAutoHide Gets a value that indicates whether scrollbars can hide itself when user is not interacting with it.
Background Gets or sets the brush used to draw the control's background.
(Inherited from TemplatedControl)
BackgroundSizing Gets or sets how the control's background is drawn relative to the control's border.
(Inherited from TemplatedControl)
BorderBrush Gets or sets the brush used to draw the control's border.
(Inherited from TemplatedControl)
BorderThickness Gets or sets the thickness of the control's border.
(Inherited from TemplatedControl)
Bounds
(Inherited from Visual)
BringIntoViewOnFocusChange Gets or sets a value that determines whether the ScrollViewer uses a bring-into-view scroll behavior when an item in the view gets focus.
BypassFlowDirectionPolicies
(Inherited from Visual)
CanHorizontallyScroll Gets a value indicating whether the viewer can scroll horizontally.
CanVerticallyScroll Gets a value indicating whether the viewer can scroll vertically.
Classes
(Inherited from StyledElement)
Clip
(Inherited from Visual)
ClipToBounds
(Inherited from Visual)
Content Gets or sets the content to display.
(Inherited from ContentControl)
ContentTemplate Gets or sets the data template used to display the content of the control.
(Inherited from ContentControl)
ContextFlyout Gets or sets a context flyout to the control
(Inherited from Control)
ContextMenu Gets or sets a context menu to the control.
(Inherited from Control)
CornerRadius Gets or sets the radius of the border rounded corners.
(Inherited from TemplatedControl)
CurrentAnchor The currently chosen anchor element to use for scroll anchoring.
Cursor
(Inherited from InputElement)
DataContext
(Inherited from StyledElement)
DataTemplates Gets or sets the data templates for the control.
(Inherited from Control)
DesiredSize
(Inherited from Layoutable)
Effect
(Inherited from Visual)
Extent Gets the extent of the scrollable content.
FlowDirection
(Inherited from Visual)
Focusable
(Inherited from InputElement)
FocusAdorner Gets or sets the control's focus adorner.
(Inherited from Control)
FontFamily Gets or sets the font family used to draw the control's text.
(Inherited from TemplatedControl)
FontFeatures Gets or sets the font features turned on/off.
(Inherited from TemplatedControl)
FontSize Gets or sets the size of the control's text in points.
(Inherited from TemplatedControl)
FontStretch Gets or sets the font stretch used to draw the control's text.
(Inherited from TemplatedControl)
FontStyle Gets or sets the font style used to draw the control's text.
(Inherited from TemplatedControl)
FontWeight Gets or sets the font weight used to draw the control's text.
(Inherited from TemplatedControl)
Foreground Gets or sets the brush used to draw the control's text and other foreground elements.
(Inherited from TemplatedControl)
GestureRecognizers
(Inherited from InputElement)
HasMirrorTransform
(Inherited from Visual)
Height
(Inherited from Layoutable)
HorizontalAlignment
(Inherited from Layoutable)
HorizontalContentAlignment Gets or sets the horizontal alignment of the content within the control.
(Inherited from ContentControl)
HorizontalScrollBarVisibility Gets or sets the horizontal scrollbar visibility.
HorizontalSnapPointsAlignment Gets or sets how the existing snap points are horizontally aligned versus the initial viewport.
HorizontalSnapPointsType Gets or sets how scroll gesture reacts to the snap points along the horizontal axis.
InheritanceParent
(Inherited from AvaloniaObject)
IsArrangeValid
(Inherited from Layoutable)
IsDeferredScrollingEnabled Gets or sets whether dragging of Thumb elements should update the ScrollViewer only when the user releases the mouse.
IsEffectivelyEnabled
(Inherited from InputElement)
IsEffectivelyVisible
(Inherited from Visual)
IsEnabled
(Inherited from InputElement)
IsEnabledCore
(Inherited from InputElement)
IsExpanded Gets a value that indicates whether any scrollbar is expanded.
IsFocused
(Inherited from InputElement)
IsHitTestVisible
(Inherited from InputElement)
IsInitialized
(Inherited from StyledElement)
IsKeyboardFocusWithin
(Inherited from InputElement)
IsLoaded Gets a value indicating whether the control is fully constructed in the visual tree and both layout and render are complete.
(Inherited from Control)
IsMeasureValid
(Inherited from Layoutable)
IsPointerOver
(Inherited from InputElement)
IsScrollChainingEnabled Gets or sets if scroll chaining is enabled. The default value is true.
IsScrollInertiaEnabled Gets or sets whether scroll gestures should include inertia in their behavior and value.
IsTabStop
(Inherited from InputElement)
IsVisible
(Inherited from Visual)
Item
(Inherited from AvaloniaObject)
Item
(Inherited from AvaloniaObject)
KeyBindings
(Inherited from InputElement)
LargeChange Gets the large (page) change value for the scroll viewer.
LogicalChildren
(Inherited from StyledElement)
Margin
(Inherited from Layoutable)
MaxHeight
(Inherited from Layoutable)
MaxWidth
(Inherited from Layoutable)
MinHeight
(Inherited from Layoutable)
MinWidth
(Inherited from Layoutable)
Name
(Inherited from StyledElement)
Offset Gets or sets the current scroll offset.
Opacity
(Inherited from Visual)
OpacityMask
(Inherited from Visual)
Padding Gets or sets the padding placed between the border of the control and its content.
(Inherited from TemplatedControl)
Parent
(Inherited from StyledElement)
Presenter Gets the presenter from the control's template.
(Inherited from ContentControl)
PseudoClasses
(Inherited from StyledElement)
RenderTransform
(Inherited from Visual)
RenderTransformOrigin
(Inherited from Visual)
Resources
(Inherited from StyledElement)
ScrollBarMaximum Gets the maximum scrolling distance (which is Extent - Viewport).
SmallChange Gets the small (line) change value for the scroll viewer.
StyleKey
(Inherited from StyledElement)
StyleKeyOverride
(Inherited from StyledElement)
Styles
(Inherited from StyledElement)
TabIndex
(Inherited from InputElement)
Tag Gets or sets a user-defined object attached to the control.
(Inherited from Control)
Template Gets or sets the template that defines the control's appearance.
(Inherited from TemplatedControl)
TemplatedParent
(Inherited from StyledElement)
Theme
(Inherited from StyledElement)
Transitions
(Inherited from Animatable)
UseLayoutRounding
(Inherited from Layoutable)
VerticalAlignment
(Inherited from Layoutable)
VerticalContentAlignment Gets or sets the vertical alignment of the content within the control.
(Inherited from ContentControl)
VerticalScrollBarVisibility Gets or sets the vertical scrollbar visibility.
VerticalSnapPointsAlignment Gets or sets how the existing snap points are vertically aligned versus the initial viewport.
VerticalSnapPointsType Gets or sets how scroll gesture reacts to the snap points along the vertical axis.
Viewport Gets the size of the viewport on the scrollable content.
VisualChildren
(Inherited from Visual)
VisualRoot
(Inherited from Visual)
Width
(Inherited from Layoutable)
ZIndex
(Inherited from Visual)

Methods

AddHandler(RoutedEvent, Delegate, RoutingStrategies, Boolean)
(Inherited from Interactive)
AddHandler``1(RoutedEventUMP, EventHandlerUMP, RoutingStrategies, Boolean)
(Inherited from Interactive)
ApplyStyling
(Inherited from StyledElement)
ApplyTemplate
(Inherited from TemplatedControl)
Arrange(Rect)
(Inherited from Layoutable)
ArrangeCore(Rect)
(Inherited from Layoutable)
ArrangeOverride(Size)
(Inherited from Layoutable)
BeginInit
(Inherited from StyledElement)
Bind(AvaloniaProperty, IBinding)
(Inherited from AvaloniaObject)
Bind(AvaloniaProperty, IObservableObject, BindingPriority)
(Inherited from AvaloniaObject)
Bind``1(DirectPropertyBaseUMP, IObservableUMP)
(Inherited from AvaloniaObject)
Bind``1(DirectPropertyBaseUMP, IObservableBindingValueUMP)
(Inherited from AvaloniaObject)
Bind``1(DirectPropertyBaseUMP, IObservableObject)
(Inherited from AvaloniaObject)
Bind``1(StyledPropertyUMP, IObservableUMP, BindingPriority)
(Inherited from AvaloniaObject)
Bind``1(StyledPropertyUMP, IObservableBindingValueUMP, BindingPriority)
(Inherited from AvaloniaObject)
Bind``1(StyledPropertyUMP, IObservableObject, BindingPriority)
(Inherited from AvaloniaObject)
BuildEventRoute(RoutedEvent)
(Inherited from Interactive)
CheckAccess
(Inherited from AvaloniaObject)
ClearValue(AvaloniaProperty)
(Inherited from AvaloniaObject)
ClearValue``1(AvaloniaPropertyUMP)
(Inherited from AvaloniaObject)
ClearValue``1(DirectPropertyBaseUMP)
(Inherited from AvaloniaObject)
ClearValue``1(StyledPropertyUMP)
(Inherited from AvaloniaObject)
CoerceValue(AvaloniaProperty)
(Inherited from AvaloniaObject)
EndInit
(Inherited from StyledElement)
Equals(Object)
(Inherited from AvaloniaObject)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Focus(NavigationMethod, KeyModifiers)
(Inherited from InputElement)
GetAllowAutoHide(Control) Gets the value of the AllowAutoHideProperty attached property.
GetBaseValue``1(StyledPropertyUMP)
(Inherited from AvaloniaObject)
GetBringIntoViewOnFocusChange(Control) Gets the value of the BringIntoViewOnFocusChange attached property.
GetHashCode
(Inherited from AvaloniaObject)
GetHorizontalScrollBarVisibility(Control) Gets the value of the HorizontalScrollBarVisibility attached property.
GetHorizontalSnapPointsAlignment(Control) Gets the value of the HorizontalSnapPointsAlignment attached property.
GetHorizontalSnapPointsType(Control) Gets the value of the HorizontalSnapPointsType attached property.
GetIsDeferredScrollingEnabled(Control) Gets whether dragging of Thumb elements should update the ScrollViewer only when the user releases the mouse.
GetIsScrollChainingEnabled(Control) Gets the value of the IsScrollChainingEnabled attached property.
GetIsScrollInertiaEnabled(Control) Gets whether scroll gestures should include inertia in their behavior and value.
GetTemplateFocusTarget Gets the element that receives the focus adorner.
(Inherited from TemplatedControl)
GetTypeGets the Type of the current instance.
(Inherited from Object)
GetValue(AvaloniaProperty)
(Inherited from AvaloniaObject)
GetValue``1(DirectPropertyBaseUMP)
(Inherited from AvaloniaObject)
GetValue``1(StyledPropertyUMP)
(Inherited from AvaloniaObject)
GetVerticalScrollBarVisibility(Control) Gets the value of the VerticalScrollBarVisibility attached property.
GetVerticalSnapPointsAlignment(Control) Gets the value of the VerticalSnapPointsAlignment attached property.
GetVerticalSnapPointsType(Control) Gets the value of the VerticalSnapPointsType attached property.
InitializeIfNeeded
(Inherited from StyledElement)
InvalidateArrange
(Inherited from Layoutable)
InvalidateMeasure
(Inherited from Layoutable)
InvalidateMirrorTransform
(Inherited from Visual)
InvalidateVisual
(Inherited from Visual)
IsAnimating(AvaloniaProperty)
(Inherited from AvaloniaObject)
IsSet(AvaloniaProperty)
(Inherited from AvaloniaObject)
LineDown Scrolls the content down one line.
LineLeft Scrolls the content left one line.
LineRight Scrolls the content right one line.
LineUp Scrolls the content up one line.
LogicalChildrenCollectionChanged(Object, NotifyCollectionChangedEventArgs)
(Inherited from Visual)
Measure(Size)
(Inherited from Layoutable)
MeasureCore(Size)
(Inherited from Layoutable)
MeasureOverride(Size)
(Inherited from Layoutable)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
OnAccessKey(RoutedEventArgs)
(Inherited from InputElement)
OnApplyTemplate(TemplateAppliedEventArgs)
(Overrides TemplatedControlOnApplyTemplate(TemplateAppliedEventArgs))
OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)
(Inherited from TemplatedControl)
OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)
(Inherited from Visual)
OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)
(Inherited from Control)
OnCreateAutomationPeer
(Overrides ControlOnCreateAutomationPeer)
OnDataContextBeginUpdate
(Inherited from StyledElement)
OnDataContextChanged(EventArgs)
(Inherited from StyledElement)
OnDataContextEndUpdate
(Inherited from StyledElement)
OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)
(Inherited from TemplatedControl)
OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)
(Inherited from Visual)
OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)
(Inherited from Control)
OnGotFocus(GotFocusEventArgs)
(Overrides ControlOnGotFocus(GotFocusEventArgs))
OnInitialized
(Inherited from StyledElement)
OnKeyDown(KeyEventArgs)
(Overrides InputElement.OnKeyDown(KeyEventArgs))
OnKeyUp(KeyEventArgs)
(Inherited from Control)
OnLoaded(RoutedEventArgs) Invoked just before the Loaded event.
(Inherited from Control)
OnLostFocus(RoutedEventArgs)
(Inherited from Control)
OnMeasureInvalidated
(Inherited from Layoutable)
OnPointerCaptureLost(PointerCaptureLostEventArgs)
(Inherited from InputElement)
OnPointerEntered(PointerEventArgs)
(Inherited from InputElement)
OnPointerExited(PointerEventArgs)
(Inherited from InputElement)
OnPointerMoved(PointerEventArgs)
(Inherited from InputElement)
OnPointerPressed(PointerPressedEventArgs)
(Inherited from InputElement)
OnPointerReleased(PointerReleasedEventArgs)
(Inherited from Control)
OnPointerWheelChanged(PointerWheelEventArgs)
(Inherited from InputElement)
OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
(Overrides ContentControlOnPropertyChanged(AvaloniaPropertyChangedEventArgs))
OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)
(Inherited from Animatable)
OnScrollChanged(ScrollChangedEventArgs) Called when a change in scrolling state is detected, such as a change in scroll position, extent, or viewport size.
OnSizeChanged(SizeChangedEventArgs) Invoked just before the SizeChanged event.
(Inherited from Control)
OnTemplateChanged(AvaloniaPropertyChangedEventArgs) Called when the Template property changes.
(Inherited from TemplatedControl)
OnTextInput(TextInputEventArgs)
(Inherited from InputElement)
OnUnloaded(RoutedEventArgs) Invoked just before the Unloaded event.
(Inherited from Control)
OnVisualParentChanged(Visual, Visual)
(Inherited from Layoutable)
PageDown Scrolls the content downward by one page.
PageLeft Scrolls the content left by one page.
PageRight Scrolls the content tight by one page.
PageUp Scrolls the content upward by one page.
RaiseEvent(RoutedEventArgs)
(Inherited from Interactive)
RaisePropertyChanged``1(DirectPropertyBaseUMP, UMP, UMP)
(Inherited from AvaloniaObject)
RegisterAnchorCandidate(Control) Registers a control as a potential scroll anchor candidate.
RegisterContentPresenter(ContentPresenter)
(Overrides ContentControlRegisterContentPresenter(ContentPresenter))
RemoveHandler(RoutedEvent, Delegate)
(Inherited from Interactive)
RemoveHandler``1(RoutedEventUMP, EventHandlerUMP)
(Inherited from Interactive)
Render(DrawingContext)
(Inherited from Visual)
ScrollToEnd Scrolls to the bottom-left corner of the content.
ScrollToHome Scrolls to the top-left corner of the content.
SetAllowAutoHide(Control, Boolean) Gets the value of the AllowAutoHideProperty attached property.
SetAndRaise``1(DirectPropertyBaseUMP, UMP, UMP)
(Inherited from AvaloniaObject)
SetBringIntoViewOnFocusChange(Control, Boolean) Gets the value of the BringIntoViewOnFocusChange attached property.
SetCurrentValue(AvaloniaProperty, Object)
(Inherited from AvaloniaObject)
SetCurrentValue``1(StyledPropertyUMP, UMP)
(Inherited from AvaloniaObject)
SetHorizontalScrollBarVisibility(Control, ScrollBarVisibility) Gets the value of the HorizontalScrollBarVisibility attached property.
SetHorizontalSnapPointsAlignment(Control, SnapPointsAlignment) Gets the value of the HorizontalSnapPointsAlignment attached property.
SetHorizontalSnapPointsType(Control, SnapPointsType) Gets the value of the HorizontalSnapPointsType attached property.
SetIsDeferredScrollingEnabled(Control, Boolean) Sets whether dragging of Thumb elements should update the ScrollViewer only when the user releases the mouse.
SetIsScrollChainingEnabled(Control, Boolean) Sets the value of the IsScrollChainingEnabled attached property.
SetIsScrollInertiaEnabled(Control, Boolean) Sets whether scroll gestures should include inertia in their behavior and value.
SetValue(AvaloniaProperty, Object, BindingPriority)
(Inherited from AvaloniaObject)
SetValue``1(DirectPropertyBaseUMP, UMP)
(Inherited from AvaloniaObject)
SetValue``1(StyledPropertyUMP, UMP, BindingPriority)
(Inherited from AvaloniaObject)
SetVerticalScrollBarVisibility(Control, ScrollBarVisibility) Gets the value of the VerticalScrollBarVisibility attached property.
SetVerticalSnapPointsAlignment(Control, SnapPointsAlignment) Gets the value of the VerticalSnapPointsAlignment attached property.
SetVerticalSnapPointsType(Control, SnapPointsType) Gets the value of the VerticalSnapPointsType attached property.
ToStringReturns a string that represents the current object.
(Inherited from Object)
TryGetResource(Object, ThemeVariant, Object)
(Inherited from StyledElement)
UnregisterAnchorCandidate(Control) Unregisters a control as a potential scroll anchor candidate.
UpdateDataValidation(AvaloniaProperty, BindingValueType, Exception)
(Inherited from AvaloniaObject)
UpdateIsEffectivelyEnabled
(Inherited from InputElement)
UpdateLayout
(Inherited from Layoutable)
VerifyAccess
(Inherited from AvaloniaObject)

Events

ActualThemeVariantChanged
(Inherited from StyledElement)
AttachedToLogicalTree
(Inherited from StyledElement)
AttachedToVisualTree
(Inherited from Visual)
ContextRequested Occurs when the user has completed a context input gesture, such as a right-click.
(Inherited from Control)
DataContextChanged
(Inherited from StyledElement)
DetachedFromLogicalTree
(Inherited from StyledElement)
DetachedFromVisualTree
(Inherited from Visual)
DoubleTapped
(Inherited from InputElement)
EffectiveViewportChanged
(Inherited from Layoutable)
GotFocus
(Inherited from InputElement)
Holding
(Inherited from InputElement)
Initialized
(Inherited from StyledElement)
KeyDown
(Inherited from InputElement)
KeyUp
(Inherited from InputElement)
LayoutUpdated
(Inherited from Layoutable)
Loaded Occurs when the control has been fully constructed in the visual tree and both layout and render are complete.
(Inherited from Control)
LostFocus
(Inherited from InputElement)
PointerCaptureLost
(Inherited from InputElement)
PointerEntered
(Inherited from InputElement)
PointerExited
(Inherited from InputElement)
PointerMoved
(Inherited from InputElement)
PointerPressed
(Inherited from InputElement)
PointerReleased
(Inherited from InputElement)
PointerWheelChanged
(Inherited from InputElement)
PropertyChanged
(Inherited from AvaloniaObject)
ResourcesChanged
(Inherited from StyledElement)
ScrollChanged Occurs when changes are detected to the scroll position, extent, or viewport size.
SizeChanged Occurs when the bounds (actual size) of the control have changed.
(Inherited from Control)
Tapped
(Inherited from InputElement)
TemplateApplied Raised when the control's template is applied.
(Inherited from TemplatedControl)
TextInput
(Inherited from InputElement)
TextInputMethodClientRequested
(Inherited from InputElement)
Unloaded Occurs when the control is removed from the visual tree.
(Inherited from Control)

Fields

Extension Methods

BringIntoView Tries to bring the control into view.
(Defined by ControlExtensions)
BringIntoView(Rect) Tries to bring the control into view.
(Defined by ControlExtensions)
FindControlT(String) Finds the named control in the scope of the specified control.
(Defined by ControlExtensions)
FindDataTemplate(Object, IDataTemplate) Find a data template that matches a piece of data.
(Defined by DataTemplateExtensions)
GetControlT(String) Finds the named control in the scope of the specified control and throws if not found.
(Defined by ControlExtensions)
GetTemplateChildren
(Defined by TemplateExtensions)

See Also