ScrollViewer Class
Definition
A control which scrolls its content if the content is bigger than the space available.
public class ScrollViewer
Constructors
| Name | Description |
|---|---|
| ScrollViewer | Initializes a new instance of the Avalonia.Controls.ScrollViewer class. |
ScrollViewer Constructor
Initializes a new instance of the Avalonia.Controls.ScrollViewer class.
public ScrollViewer()
Methods
| Name | Description |
|---|---|
| AddHandler (2 overloads) | Adds a handler for the specified routed event. Inherited from Interactive. |
| ApplyStyling | Applies styling to the control if the control is initialized and styling is not already applied. Inherited from StyledElement. |
| ApplyTemplate | Creates the visual children of the control, if necessary Inherited from TemplatedControl. |
| Arrange | Arranges the control and its children. Inherited from Layoutable. |
| BeginInit | Inherited from StyledElement. |
| Bind (8 overloads) | Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject. |
| CheckAccess | Returns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject. |
| ClearValue (4 overloads) | Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject. |
| CoerceValue | Coerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject. |
| EndInit | Inherited from StyledElement. |
| Equals | Compares two objects using reference equality. Inherited from AvaloniaObject. |
| Focus | Focuses the control. Inherited from InputElement. |
| GetAllowAutoHide | Gets the value of the AllowAutoHideProperty attached property. |
| GetBaseValue | Inherited from AvaloniaObject. |
| GetBringIntoViewOnFocusChange | Gets the value of the Avalonia.Controls.ScrollViewer.BringIntoViewOnFocusChange attached property. |
| GetFlowDirection | Gets the value of the attached Avalonia.Visual.FlowDirectionProperty on a control. Inherited from Visual. |
| GetHashCode | Gets the hash code for the object. Inherited from AvaloniaObject. |
| GetHorizontalScrollBarVisibility | Gets the value of the HorizontalScrollBarVisibility attached property. |
| GetHorizontalSnapPointsAlignment | Gets the value of the HorizontalSnapPointsAlignment attached property. |
| GetHorizontalSnapPointsType | Gets the value of the HorizontalSnapPointsType attached property. |
| GetIsDeferredScrollingEnabled | Gets whether dragging of Avalonia.Controls.Primitives.Thumb elements should update the Avalonia.Controls.ScrollViewer only when the user releases the mouse. |
| GetIsHoldingEnabled | Inherited from InputElement. |
| GetIsHoldWithMouseEnabled | Inherited from InputElement. |
| GetIsScrollChainingEnabled | Gets the value of the IsScrollChainingEnabled attached property. |
| GetIsScrollInertiaEnabled | Gets whether scroll gestures should include inertia in their behavior and value. |
| GetIsTemplateFocusTarget | Gets the value of the IsTemplateFocusTargetProperty attached property on a control. Inherited from TemplatedControl. |
| GetValue (3 overloads) | Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| GetVerticalScrollBarVisibility | Gets the value of the VerticalScrollBarVisibility attached property. |
| GetVerticalSnapPointsAlignment | Gets the value of the VerticalSnapPointsAlignment attached property. |
| GetVerticalSnapPointsType | Gets the value of the VerticalSnapPointsType attached property. |
| InvalidateArrange | Invalidates the arrangement of the control and queues a new layout pass. Inherited from Layoutable. |
| InvalidateMeasure | Invalidates the measurement of the control and queues a new layout pass. Inherited from Layoutable. |
| InvalidateVisual | Invalidates the visual and queues a repaint. Inherited from Visual. |
| IsAnimating | Checks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject. |
| IsSet | Checks whether a Avalonia.AvaloniaProperty is set on this object. 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. |
| Measure | Carries out a measure of the control. 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 | Raises a routed event. Inherited from Interactive. |
| RegisterAnchorCandidate | Registers a control as a potential scroll anchor candidate. |
| RemoveHandler (2 overloads) | Removes a handler for the specified routed event. Inherited from Interactive. |
| Render | Renders the visual to a Avalonia.Media.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 | Gets the value of the AllowAutoHideProperty attached property. |
| SetBringIntoViewOnFocusChange | Gets the value of the Avalonia.Controls.ScrollViewer.BringIntoViewOnFocusChange attached property. |
| SetCurrentValue (2 overloads) | Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject. |
| SetFlowDirection | Sets the value of the attached Avalonia.Visual.FlowDirectionProperty on a control. Inherited from Visual. |
| SetHorizontalScrollBarVisibility | Gets the value of the HorizontalScrollBarVisibility attached property. |
| SetHorizontalSnapPointsAlignment | Gets the value of the HorizontalSnapPointsAlignment attached property. |
| SetHorizontalSnapPointsType | Gets the value of the HorizontalSnapPointsType attached property. |
| SetIsDeferredScrollingEnabled | Sets whether dragging of Avalonia.Controls.Primitives.Thumb elements should update the Avalonia.Controls.ScrollViewer only when the user releases the mouse. |
| SetIsHoldingEnabled | Inherited from InputElement. |
| SetIsHoldWithMouseEnabled | Inherited from InputElement. |
| SetIsScrollChainingEnabled | Sets the value of the IsScrollChainingEnabled attached property. |
| SetIsScrollInertiaEnabled | Sets whether scroll gestures should include inertia in their behavior and value. |
| SetIsTemplateFocusTarget | Sets the value of the IsTemplateFocusTargetProperty attached property on a control. Inherited from TemplatedControl. |
| SetValue (3 overloads) | Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| SetVerticalScrollBarVisibility | Gets the value of the VerticalScrollBarVisibility attached property. |
| SetVerticalSnapPointsAlignment | Gets the value of the VerticalSnapPointsAlignment attached property. |
| SetVerticalSnapPointsType | Gets the value of the VerticalSnapPointsType attached property. |
| TryGetResource | Inherited from StyledElement. |
| UnregisterAnchorCandidate | Unregisters a control as a potential scroll anchor candidate. |
| UpdateLayout | Executes a layout pass. Inherited from Layoutable. |
| VerifyAccess | Checks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject. |
GetAllowAutoHide Method
Gets the value of the AllowAutoHideProperty attached property.
public bool GetAllowAutoHide(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
The control to read the value from.
Returns
bool
The value of the property.
GetBringIntoViewOnFocusChange Method
Gets the value of the Avalonia.Controls.ScrollViewer.BringIntoViewOnFocusChange attached property.
public bool GetBringIntoViewOnFocusChange(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
The control to read the value from.
Returns
bool
The value of the property.
GetHorizontalScrollBarVisibility Method
Gets the value of the HorizontalScrollBarVisibility attached property.
public Avalonia.Controls.Primitives.ScrollBarVisibility GetHorizontalScrollBarVisibility(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
The control to read the value from.
Returns
Avalonia.Controls.Primitives.ScrollBarVisibility
The value of the property.
GetHorizontalSnapPointsAlignment Method
Gets the value of the HorizontalSnapPointsAlignment attached property.
public Avalonia.Controls.Primitives.SnapPointsAlignment GetHorizontalSnapPointsAlignment(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
The control to read the value from.
Returns
Avalonia.Controls.Primitives.SnapPointsAlignment
The value of the property.
GetHorizontalSnapPointsType Method
Gets the value of the HorizontalSnapPointsType attached property.
public Avalonia.Controls.Primitives.SnapPointsType GetHorizontalSnapPointsType(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
The control to read the value from.
Returns
Avalonia.Controls.Primitives.SnapPointsType
The value of the property.
GetIsDeferredScrollingEnabled Method
Gets whether dragging of Avalonia.Controls.Primitives.Thumb elements should update the Avalonia.Controls.ScrollViewer only when the user releases the mouse.
public bool GetIsDeferredScrollingEnabled(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
Returns
bool
GetIsScrollChainingEnabled Method
Gets the value of the IsScrollChainingEnabled attached property.
public bool GetIsScrollChainingEnabled(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
The control to read the value from.
Returns
bool
The value of the property.
Remarks
After a user hits a scroll limit on an element that has been nested within another scrollable element, you can specify whether that parent element should continue the scrolling operation begun in its child element. This is called scroll chaining.
GetIsScrollInertiaEnabled Method
Gets whether scroll gestures should include inertia in their behavior and value.
public bool GetIsScrollInertiaEnabled(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
Returns
bool
GetVerticalScrollBarVisibility Method
Gets the value of the VerticalScrollBarVisibility attached property.
public Avalonia.Controls.Primitives.ScrollBarVisibility GetVerticalScrollBarVisibility(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
The control to read the value from.
Returns
Avalonia.Controls.Primitives.ScrollBarVisibility
The value of the property.
GetVerticalSnapPointsAlignment Method
Gets the value of the VerticalSnapPointsAlignment attached property.
public Avalonia.Controls.Primitives.SnapPointsAlignment GetVerticalSnapPointsAlignment(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
The control to read the value from.
Returns
Avalonia.Controls.Primitives.SnapPointsAlignment
The value of the property.
GetVerticalSnapPointsType Method
Gets the value of the VerticalSnapPointsType attached property.
public Avalonia.Controls.Primitives.SnapPointsType GetVerticalSnapPointsType(Avalonia.Controls.Control control)
Parameters
control Avalonia.Controls.Control
The control to read the value from.
Returns
Avalonia.Controls.Primitives.SnapPointsType
The value of the property.
LineDown Method
Scrolls the content down one line.
public void LineDown()
LineLeft Method
Scrolls the content left one line.
public void LineLeft()
LineRight Method
Scrolls the content right one line.
public void LineRight()
LineUp Method
Scrolls the content up one line.
public void LineUp()
PageDown Method
Scrolls the content downward by one page.
public void PageDown()
PageLeft Method
Scrolls the content left by one page.
public void PageLeft()
PageRight Method
Scrolls the content tight by one page.
public void PageRight()
PageUp Method
Scrolls the content upward by one page.
public void PageUp()
RegisterAnchorCandidate Method
Registers a control as a potential scroll anchor candidate.
public void RegisterAnchorCandidate(Avalonia.Controls.Control element)
Parameters
element Avalonia.Controls.Control
A control within the subtree of the Avalonia.Controls.IScrollAnchorProvider.
ScrollToEnd Method
Scrolls to the bottom-left corner of the content.
public void ScrollToEnd()
ScrollToHome Method
Scrolls to the top-left corner of the content.
public void ScrollToHome()
SetAllowAutoHide Method
Gets the value of the AllowAutoHideProperty attached property.
public void SetAllowAutoHide(Avalonia.Controls.Control control, bool value)
Parameters
control Avalonia.Controls.Control
The control to set the value on.
value bool
The value of the property.
SetBringIntoViewOnFocusChange Method
Gets the value of the Avalonia.Controls.ScrollViewer.BringIntoViewOnFocusChange attached property.
public void SetBringIntoViewOnFocusChange(Avalonia.Controls.Control control, bool value)
Parameters
control Avalonia.Controls.Control
The control to set the value on.
value bool
The value of the property.
SetHorizontalScrollBarVisibility Method
Gets the value of the HorizontalScrollBarVisibility attached property.
public void SetHorizontalScrollBarVisibility(Avalonia.Controls.Control control, Avalonia.Controls.Primitives.ScrollBarVisibility value)
Parameters
control Avalonia.Controls.Control
The control to set the value on.
value Avalonia.Controls.Primitives.ScrollBarVisibility
The value of the property.
SetHorizontalSnapPointsAlignment Method
Gets the value of the HorizontalSnapPointsAlignment attached property.
public void SetHorizontalSnapPointsAlignment(Avalonia.Controls.Control control, Avalonia.Controls.Primitives.SnapPointsAlignment value)
Parameters
control Avalonia.Controls.Control
The control to set the value on.
value Avalonia.Controls.Primitives.SnapPointsAlignment
The value of the property.
SetHorizontalSnapPointsType Method
Gets the value of the HorizontalSnapPointsType attached property.
public void SetHorizontalSnapPointsType(Avalonia.Controls.Control control, Avalonia.Controls.Primitives.SnapPointsType value)
Parameters
control Avalonia.Controls.Control
The control to set the value on.
value Avalonia.Controls.Primitives.SnapPointsType
The value of the property.
SetIsDeferredScrollingEnabled Method
Sets whether dragging of Avalonia.Controls.Primitives.Thumb elements should update the Avalonia.Controls.ScrollViewer only when the user releases the mouse.
public void SetIsDeferredScrollingEnabled(Avalonia.Controls.Control control, bool value)
Parameters
control Avalonia.Controls.Control
value bool
SetIsScrollChainingEnabled Method
Sets the value of the IsScrollChainingEnabled attached property.
public void SetIsScrollChainingEnabled(Avalonia.Controls.Control control, bool value)
Parameters
control Avalonia.Controls.Control
The control to set the value on.
value bool
The value of the property.
Remarks
After a user hits a scroll limit on an element that has been nested within another scrollable element, you can specify whether that parent element should continue the scrolling operation begun in its child element. This is called scroll chaining.