是否有可能在WPF列表视图实现平滑滚动?有可能、平滑、视图、列表

2023-09-02 21:10:31 作者:甜辛

是否有可能实现平滑滚动在WPF 列表视图喜欢它是如何工作在Firefox? 当Firefox浏览器包含了所有的列表视图的项目,你按住鼠标中键(但不释放),并拖动它,它应该能够顺利进行滚动列表视图项目。当你释放它应该停止。

Is it possible to implement smooth scroll in a WPF listview like how it works in Firefox? When the Firefox browser contained all listview items and you hold down the middle mouse button (but not release), and drag it, it should smoothly scroll the listview items. When you release it should stop.

看起来这是不可能的的WinForms,但我想知道,如果它是可用在WPF?

It looks like this is not possible in winforms, but I am wondering if it is available in WPF?

推荐答案

可以实现平滑滚动,但你失去了虚拟化项目,所以基本上只有当你有列表中的一些元素,你应该使用这种方法:

You can achieve smooth scrolling but you lose item virtualisation, so basically you should use this technique only if you have few elements in the list:

信息在这里:Smooth滚动的列表框

您是否尝试过设置:的

ScrollViewer.CanContentScroll="False"

     

在列表框中?的

通过这种方式,滚动的面板,而不是列表框处理......你输了虚拟化,如果你这样做,虽然如此,如果你有很多的内容可能会比较慢。的