是否有可能在4.5.2中实现列表(来自ItemsControl或使用ListView/ListBox),具有平滑的、基于像素的滚动、虚拟化和触摸滚动,允许在触摸屏上使用手指/轻击滚动?
我可以使用虚拟化实现平滑滚动,但如果我失去了其中的任何一个,我的首选将是虚拟化,所以对于非虚拟化列表,拥有平滑的触摸滚动将是很棒的。
到目前为止的代码:
IsSynchronizedWithCurrentItem="True" ScrollViewer.PanningMode="VerticalOnly" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.ScrollUnit="Pixel"><ListBox.ItemTemplate>
<DataTemplate>
<!-- the item in the list -->
</DataTemplate>
</ListBox.ItemTemplate>
发布于 2016-09-28 01:46:01
除了设置启用触摸输入的ScrollViewer.PanningMode=".."之外,还可以尝试在ScrollViewer或列表框/列表视图的内部ScrollViewer中设置ScrollViewer.CanContentScroll="False"。
这应该会起作用,但不幸的是,这也会阻止虚拟化的工作。请参阅MS Documentation for CanContentScrollProperty.上的备注
有关更多信息,请查看以下地址的答案:
https://stackoverflow.com/questions/39727992
复制相似问题