Browse Source
Merge pull request #10289 from AvaloniaUI/scroll_inertia_attached_getters
pull/10299/head
Wiesław Šoltés
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
18 additions and
0 deletions
-
src/Avalonia.Controls/ScrollViewer.cs
-
src/Avalonia.Themes.Fluent/Controls/ListBox.xaml
|
|
|
@ -775,6 +775,22 @@ namespace Avalonia.Controls |
|
|
|
control.SetValue(VerticalScrollBarVisibilityProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets whether scroll gestures should include inertia in their behavior and value.
|
|
|
|
/// </summary>
|
|
|
|
public static bool GetIsScrollInertiaEnabled(Control control) |
|
|
|
{ |
|
|
|
return control.GetValue(IsScrollInertiaEnabledProperty); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets whether scroll gestures should include inertia in their behavior and value.
|
|
|
|
/// </summary>
|
|
|
|
public static void SetIsScrollInertiaEnabled(Control control, bool value) |
|
|
|
{ |
|
|
|
control.SetValue(IsScrollInertiaEnabledProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public void RegisterAnchorCandidate(Control element) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -19,6 +19,7 @@ |
|
|
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" /> |
|
|
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> |
|
|
|
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" /> |
|
|
|
<Setter Property="ScrollViewer.IsScrollInertiaEnabled" Value="True" /> |
|
|
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|
|
|
<Setter Property="Template"> |
|
|
|
<ControlTemplate> |
|
|
|
@ -34,6 +35,7 @@ |
|
|
|
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" |
|
|
|
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}" |
|
|
|
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}" |
|
|
|
IsScrollInertiaEnabled="{TemplateBinding (ScrollViewer.IsScrollInertiaEnabled)}" |
|
|
|
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"> |
|
|
|
<ItemsPresenter Name="PART_ItemsPresenter" |
|
|
|
AreVerticalSnapPointsRegular="{TemplateBinding AreVerticalSnapPointsRegular}" |
|
|
|
|