diff --git a/src/Avalonia.Controls/ScrollViewer.cs b/src/Avalonia.Controls/ScrollViewer.cs
index 1c23919d0e..ab114da933 100644
--- a/src/Avalonia.Controls/ScrollViewer.cs
+++ b/src/Avalonia.Controls/ScrollViewer.cs
@@ -154,15 +154,15 @@ namespace Avalonia.Controls
///
/// Defines the property.
///
- public static readonly StyledProperty HorizontalSnapPointsTypeProperty =
- AvaloniaProperty.Register(
+ public static readonly AttachedProperty HorizontalSnapPointsTypeProperty =
+ AvaloniaProperty.RegisterAttached(
nameof(HorizontalSnapPointsType));
///
/// Defines the property.
///
- public static readonly StyledProperty VerticalSnapPointsTypeProperty =
- AvaloniaProperty.Register(
+ public static readonly AttachedProperty VerticalSnapPointsTypeProperty =
+ AvaloniaProperty.RegisterAttached(
nameof(VerticalSnapPointsType));
///
@@ -625,6 +625,86 @@ namespace Avalonia.Controls
control.SetValue(HorizontalScrollBarVisibilityProperty, value);
}
+ ///
+ /// Gets the value of the HorizontalSnapPointsType attached property.
+ ///
+ /// The control to read the value from.
+ /// The value of the property.
+ public static SnapPointsType GetHorizontalSnapPointsType(Control control)
+ {
+ return control.GetValue(HorizontalSnapPointsTypeProperty);
+ }
+
+ ///
+ /// Gets the value of the HorizontalSnapPointsType attached property.
+ ///
+ /// The control to set the value on.
+ /// The value of the property.
+ public static void SetHorizontalSnapPointsType(Control control, SnapPointsType value)
+ {
+ control.SetValue(HorizontalSnapPointsTypeProperty, value);
+ }
+
+ ///
+ /// Gets the value of the VerticalSnapPointsType attached property.
+ ///
+ /// The control to read the value from.
+ /// The value of the property.
+ public static SnapPointsType GetVerticalSnapPointsType(Control control)
+ {
+ return control.GetValue(VerticalSnapPointsTypeProperty);
+ }
+
+ ///
+ /// Gets the value of the VerticalSnapPointsType attached property.
+ ///
+ /// The control to set the value on.
+ /// The value of the property.
+ public static void SetVerticalSnapPointsType(Control control, SnapPointsType value)
+ {
+ control.SetValue(VerticalSnapPointsTypeProperty, value);
+ }
+
+ ///
+ /// Gets the value of the HorizontalSnapPointsAlignment attached property.
+ ///
+ /// The control to read the value from.
+ /// The value of the property.
+ public static SnapPointsAlignment GetHorizontalSnapPointsAlignment(Control control)
+ {
+ return control.GetValue(HorizontalSnapPointsAlignmentProperty);
+ }
+
+ ///
+ /// Gets the value of the HorizontalSnapPointsAlignment attached property.
+ ///
+ /// The control to set the value on.
+ /// The value of the property.
+ public static void SetHorizontalSnapPointsAlignment(Control control, SnapPointsAlignment value)
+ {
+ control.SetValue(HorizontalSnapPointsAlignmentProperty, value);
+ }
+
+ ///
+ /// Gets the value of the VerticalSnapPointsAlignment attached property.
+ ///
+ /// The control to read the value from.
+ /// The value of the property.
+ public static SnapPointsAlignment GetVerticalSnapPointsAlignment(Control control)
+ {
+ return control.GetValue(VerticalSnapPointsAlignmentProperty);
+ }
+
+ ///
+ /// Gets the value of the VerticalSnapPointsAlignment attached property.
+ ///
+ /// The control to set the value on.
+ /// The value of the property.
+ public static void SetVerticalSnapPointsAlignment(Control control, SnapPointsAlignment value)
+ {
+ control.SetValue(VerticalSnapPointsAlignmentProperty, value);
+ }
+
///
/// Gets the value of the VerticalScrollBarVisibility attached property.
///