我有一个 ScrollViewer,它包含一个包含 2 个 ListViews 的 Horizontal StackPanel。
我的目标是让 2 个 ListView 一起滚动。我遇到的问题是我无法禁用 ListViews 中的内置 ScrollViewers ......无论我做什么,它们都会继续独立滚动。我真的必须错过一些东西......任何帮助将不胜感激。
这是我的 XAML:
<ScrollViewer VerticalScrollBarVisibility="Visible"
HorizontalScrollBarVisibility="Disabled"
ZoomMode="Disabled"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Width="830"
Height="500">
<StackPanel x:Name="teesSP"
HorizontalAlignment="Left"
Height="500"
Width="830"
Orientation="Horizontal"
VerticalAlignment="Top">
<ListView x:Name="timesLV1"
HorizontalAlignment="Left"
Width="130"
Height="500"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollMode="Disabled"
ScrollViewer.IsHorizontalRailEnabled="False"
ScrollViewer.IsHorizontalScrollChainingEnabled="False"
ScrollViewer.IsScrollInertiaEnabled="False"
ScrollViewer.IsVerticalRailEnabled="False"
ScrollViewer.IsVerticalScrollChainingEnabled="False"
ScrollViewer.IsZoomChainingEnabled="False"
ScrollViewer.IsZoomInertiaEnabled="False"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollMode="Disabled"
BorderThickness="2"
BorderBrush="Black"
VerticalAlignment="Top"
ItemTemplate="{StaticResource TimeTileTemplate}"
SelectionMode="Single"
SelectionChanged="timesLV_Click" />
<ListView x:Name="timesLV2"
HorizontalAlignment="Left"
Width="700"
Height="500"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollMode="Disabled"
ScrollViewer.IsHorizontalRailEnabled="False"
ScrollViewer.IsHorizontalScrollChainingEnabled="False"
ScrollViewer.IsScrollInertiaEnabled="False"
ScrollViewer.IsVerticalRailEnabled="False"
ScrollViewer.IsVerticalScrollChainingEnabled="False"
ScrollViewer.IsZoomChainingEnabled="False"
ScrollViewer.IsZoomInertiaEnabled="False"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollMode="Disabled"
BorderThickness="2"
BorderBrush="Black"
VerticalAlignment="Top"
ItemTemplate="{StaticResource TimeTileTemplate}"
SelectionMode="Single"
SelectionChanged="timesLV_Click" />
</StackPanel>
</ScrollViewer>