From 87709b960637a4bf12a170d95dd4f420eab31c09 Mon Sep 17 00:00:00 2001 From: Emmanuel Hansen Date: Thu, 9 Feb 2023 20:44:12 +0000 Subject: [PATCH] add IsScrollInertiaEnabled setter and getter --- src/Avalonia.Controls/ScrollViewer.cs | 16 ++++++++++++++++ src/Avalonia.Themes.Fluent/Controls/ListBox.xaml | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/Avalonia.Controls/ScrollViewer.cs b/src/Avalonia.Controls/ScrollViewer.cs index ab114da933..af874bd380 100644 --- a/src/Avalonia.Controls/ScrollViewer.cs +++ b/src/Avalonia.Controls/ScrollViewer.cs @@ -775,6 +775,22 @@ namespace Avalonia.Controls control.SetValue(VerticalScrollBarVisibilityProperty, value); } + /// + /// Gets whether scroll gestures should include inertia in their behavior and value. + /// + public static bool GetIsScrollInertiaEnabled(Control control) + { + return control.GetValue(IsScrollInertiaEnabledProperty); + } + + /// + /// Sets whether scroll gestures should include inertia in their behavior and value. + /// + public static void SetIsScrollInertiaEnabled(Control control, bool value) + { + control.SetValue(IsScrollInertiaEnabledProperty, value); + } + /// public void RegisterAnchorCandidate(Control element) { diff --git a/src/Avalonia.Themes.Fluent/Controls/ListBox.xaml b/src/Avalonia.Themes.Fluent/Controls/ListBox.xaml index 4b9fb76b8a..e2273cd487 100644 --- a/src/Avalonia.Themes.Fluent/Controls/ListBox.xaml +++ b/src/Avalonia.Themes.Fluent/Controls/ListBox.xaml @@ -19,6 +19,7 @@ + @@ -34,6 +35,7 @@ HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}" IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}" + IsScrollInertiaEnabled="{TemplateBinding (ScrollViewer.IsScrollInertiaEnabled)}" AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}">