Glen Stone
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
25 additions and
4 deletions
-
src/Avalonia.Controls.DataGrid/DataGrid.cs
-
src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml
-
src/Avalonia.Controls.DataGrid/Themes/Simple.xaml
|
|
|
@ -412,6 +412,21 @@ namespace Avalonia.Controls |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="IsScrollInertiaEnabled"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static readonly AttachedProperty<bool> IsScrollInertiaEnabledProperty = |
|
|
|
ScrollViewer.IsScrollInertiaEnabledProperty.AddOwner<DataGrid>(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets whether scroll gestures should include inertia in their behavior and value.
|
|
|
|
/// </summary>
|
|
|
|
public bool IsScrollInertiaEnabled |
|
|
|
{ |
|
|
|
get => GetValue(IsScrollInertiaEnabledProperty); |
|
|
|
set => SetValue(IsScrollInertiaEnabledProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
private bool _isValid = true; |
|
|
|
|
|
|
|
public static readonly DirectProperty<DataGrid, bool> IsValidProperty = |
|
|
|
|
|
|
|
@ -532,9 +532,13 @@ |
|
|
|
<DataGridRowsPresenter Name="PART_RowsPresenter" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.RowSpan="2" |
|
|
|
Grid.ColumnSpan="3" Grid.Column="0"> |
|
|
|
Grid.ColumnSpan="3" |
|
|
|
Grid.Column="0" |
|
|
|
ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"> |
|
|
|
<DataGridRowsPresenter.GestureRecognizers> |
|
|
|
<ScrollGestureRecognizer CanHorizontallyScroll="True" CanVerticallyScroll="True" /> |
|
|
|
<ScrollGestureRecognizer CanHorizontallyScroll="True" |
|
|
|
CanVerticallyScroll="True" |
|
|
|
IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_RowsPresenter}" /> |
|
|
|
</DataGridRowsPresenter.GestureRecognizers> |
|
|
|
</DataGridRowsPresenter> |
|
|
|
<Rectangle Name="PART_BottomRightCorner" |
|
|
|
|
|
|
|
@ -335,10 +335,12 @@ |
|
|
|
|
|
|
|
<DataGridRowsPresenter Name="PART_RowsPresenter" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.ColumnSpan="2"> |
|
|
|
Grid.ColumnSpan="2" |
|
|
|
ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"> |
|
|
|
<DataGridRowsPresenter.GestureRecognizers> |
|
|
|
<ScrollGestureRecognizer CanHorizontallyScroll="True" |
|
|
|
CanVerticallyScroll="True" /> |
|
|
|
CanVerticallyScroll="True" |
|
|
|
IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_RowsPresenter}" /> |
|
|
|
</DataGridRowsPresenter.GestureRecognizers> |
|
|
|
</DataGridRowsPresenter> |
|
|
|
<Rectangle Name="PART_BottomRightCorner" |
|
|
|
|