Class ScrollContentPresenter
- Namespace
- Avalonia.Controls.Presenters
- Assembly
- Avalonia.Controls.dll
Presents a scrolling view of content inside a ScrollViewer.
public class ScrollContentPresenter : ContentPresenter, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IScrollable, IScrollAnchorProvider
- Inheritance
-
ScrollContentPresenter
- Implements
- Inherited Members
- Extension Methods
Constructors
ScrollContentPresenter()
Initializes a new instance of the ScrollContentPresenter class.
public ScrollContentPresenter()
Fields
CanHorizontallyScrollProperty
Defines the CanHorizontallyScroll property.
public static readonly StyledProperty<bool> CanHorizontallyScrollProperty
Field Value
CanVerticallyScrollProperty
Defines the CanVerticallyScroll property.
public static readonly StyledProperty<bool> CanVerticallyScrollProperty
Field Value
ExtentProperty
Defines the Extent property.
public static readonly DirectProperty<ScrollContentPresenter, Size> ExtentProperty
Field Value
HorizontalSnapPointsAlignmentProperty
Defines the HorizontalSnapPointsAlignment property.
public static readonly StyledProperty<SnapPointsAlignment> HorizontalSnapPointsAlignmentProperty
Field Value
HorizontalSnapPointsTypeProperty
Defines the HorizontalSnapPointsType property.
public static readonly StyledProperty<SnapPointsType> HorizontalSnapPointsTypeProperty
Field Value
IsScrollChainingEnabledProperty
Defines the IsScrollChainingEnabled property.
public static readonly StyledProperty<bool> IsScrollChainingEnabledProperty
Field Value
OffsetProperty
Defines the Offset property.
public static readonly StyledProperty<Vector> OffsetProperty
Field Value
VerticalSnapPointsAlignmentProperty
Defines the VerticalSnapPointsAlignment property.
public static readonly StyledProperty<SnapPointsAlignment> VerticalSnapPointsAlignmentProperty
Field Value
VerticalSnapPointsTypeProperty
Defines the VerticalSnapPointsType property.
public static readonly StyledProperty<SnapPointsType> VerticalSnapPointsTypeProperty
Field Value
ViewportProperty
Defines the Viewport property.
public static readonly DirectProperty<ScrollContentPresenter, Size> ViewportProperty
Field Value
Properties
CanHorizontallyScroll
Gets or sets a value indicating whether the content can be scrolled horizontally.
public bool CanHorizontallyScroll { get; set; }
Property Value
CanVerticallyScroll
Gets or sets a value indicating whether the content can be scrolled horizontally.
public bool CanVerticallyScroll { get; set; }
Property Value
Extent
Gets the extent of the scrollable content.
public Size Extent { get; }
Property Value
HorizontalSnapPointsAlignment
Gets or sets how the existing snap points are horizontally aligned versus the initial viewport.
public SnapPointsAlignment HorizontalSnapPointsAlignment { get; set; }
Property Value
HorizontalSnapPointsType
Gets or sets how scroll gesture reacts to the snap points along the horizontal axis.
public SnapPointsType HorizontalSnapPointsType { get; set; }
Property Value
IsScrollChainingEnabled
Gets or sets if scroll chaining is enabled. The default value is true.
public bool IsScrollChainingEnabled { get; set; }
Property Value
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.
Offset
Gets or sets the current scroll offset.
public Vector Offset { get; set; }
Property Value
VerticalSnapPointsAlignment
Gets or sets how the existing snap points are vertically aligned versus the initial viewport.
public SnapPointsAlignment VerticalSnapPointsAlignment { get; set; }
Property Value
VerticalSnapPointsType
Gets or sets how scroll gesture reacts to the snap points along the vertical axis.
public SnapPointsType VerticalSnapPointsType { get; set; }
Property Value
Viewport
Gets the size of the viewport on the scrollable content.
public Size Viewport { get; }
Property Value
Methods
ArrangeOverride(Size)
Positions child elements as part of a layout pass.
protected override Size ArrangeOverride(Size finalSize)
Parameters
finalSize
SizeThe size available to the control.
Returns
- Size
The actual size used.
BringDescendantIntoView(Visual, Rect)
Attempts to bring a portion of the target visual into view by scrolling the content.
public bool BringDescendantIntoView(Visual target, Rect targetRect)
Parameters
target
VisualThe target visual.
targetRect
RectThe portion of the target visual to bring into view.
Returns
- bool
True if the scroll offset was changed; otherwise false.
MeasureOverride(Size)
Measures the control and its child elements as part of a layout pass.
protected override Size MeasureOverride(Size availableSize)
Parameters
availableSize
SizeThe size available to the control.
Returns
- Size
The desired size for the control.
OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)
Called when the control is added to a rooted visual tree.
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
Parameters
e
VisualTreeAttachmentEventArgsThe event args.
OnPointerWheelChanged(PointerWheelEventArgs)
Called before the PointerWheelChanged event occurs.
protected override void OnPointerWheelChanged(PointerWheelEventArgs e)
Parameters
e
PointerWheelEventArgsThe event args.
OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Called when a avalonia property changes on the object.
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
Parameters
change
AvaloniaPropertyChangedEventArgsThe property change details.