是否可以在 WPF 列表视图中实现平滑滚动? [英] Is it possible to implement smooth scroll in a WPF listview?

查看:25
本文介绍了是否可以在 WPF 列表视图中实现平滑滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以像在 Firefox 中一样在 WPF listview 中实现平滑滚动?
当 Firefox 浏览器包含所有 listview 项目并且您按住鼠标中键(但不释放)并拖动它时,它应该平滑地滚动 listview 项目.当你释放它应该停止.

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"

在列表框中?

这样滚动是由面板而不是列表框处理的...如果你这样做,你会失去虚拟化,所以如果你有很多内容,它可能会更慢.

这篇关于是否可以在 WPF 列表视图中实现平滑滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆