diff --git a/src/Avalonia.Controls.DataGrid/DataGrid.cs b/src/Avalonia.Controls.DataGrid/DataGrid.cs index 311fb3de408..d7d50f1d6e0 100644 --- a/src/Avalonia.Controls.DataGrid/DataGrid.cs +++ b/src/Avalonia.Controls.DataGrid/DataGrid.cs @@ -412,6 +412,21 @@ private void OnAreRowGroupHeadersFrozenChanged(AvaloniaPropertyChangedEventArgs } } + /// + /// Defines the property. + /// + public static readonly AttachedProperty IsScrollInertiaEnabledProperty = + ScrollViewer.IsScrollInertiaEnabledProperty.AddOwner(); + + /// + /// Gets or sets whether scroll gestures should include inertia in their behavior and value. + /// + public bool IsScrollInertiaEnabled + { + get => GetValue(IsScrollInertiaEnabledProperty); + set => SetValue(IsScrollInertiaEnabledProperty, value); + } + private bool _isValid = true; public static readonly DirectProperty IsValidProperty = diff --git a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml index 2d40721bbff..4f4ae74dd9e 100644 --- a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml +++ b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml @@ -532,9 +532,13 @@ + Grid.ColumnSpan="3" + Grid.Column="0" + ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"> - + + Grid.ColumnSpan="2" + ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"> + CanVerticallyScroll="True" + IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_RowsPresenter}" />