fix: fix scrollviewer binding according to https://github.com/AvaloniaUI/Avalonia/pull/11456

This commit is contained in:
rabbitism 2023-05-30 12:09:24 +08:00
parent 49c95dcb5e
commit 4842270a96

View File

@ -214,13 +214,14 @@
Background="{TemplateBinding Background}"
HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}"
HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}"
ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"
VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}"
VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}">
<ScrollContentPresenter.GestureRecognizers>
<ScrollGestureRecognizer
CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}"
CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}"
IsScrollInertiaEnabled="{Binding IsScrollInertiaEnabled, RelativeSource={RelativeSource TemplatedParent}}" />
IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" />
</ScrollContentPresenter.GestureRecognizers>
</ScrollContentPresenter>
<ScrollBar
@ -263,13 +264,14 @@
Background="{TemplateBinding Background}"
HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}"
HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}"
ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"
VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}"
VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}">
<ScrollContentPresenter.GestureRecognizers>
<ScrollGestureRecognizer
CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}"
CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}"
IsScrollInertiaEnabled="{Binding IsScrollInertiaEnabled, RelativeSource={RelativeSource TemplatedParent}}" />
IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" />
</ScrollContentPresenter.GestureRecognizers>
</ScrollContentPresenter>
<ScrollBar