为什么将ScrollViewer.CanContentScroll设置为false会禁用虚拟化 [英] why setting ScrollViewer.CanContentScroll to false disable virtualization

查看:535
本文介绍了为什么将ScrollViewer.CanContentScroll设置为false会禁用虚拟化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如大多数WPF开发人员所知,将ScrollViewer.CanContentScroll设置为false会禁用虚拟化;请参见图3.但是我想知道它是如何工作的,因为我尝试在将ScrollViewer.CanContentScroll设置为false的同时启用虚拟化.

As most WPF developers know, setting ScrollViewer.CanContentScroll to false will disable virtualization; but I'd like to know how it works, because I try to enable virtualization while setting ScrollViewer.CanContentScroll to false.

推荐答案

"ScrollViewer当前允许两种滚动模式:逐像素平滑滚动(CanContentScroll = false)或逐项逐项滚动(CanContentScroll = true).当前,WPF仅在按项目滚动时支持UI虚拟化.基于项目的滚动也称为物理滚动",基于项目的滚动也称为逻辑滚动".

"ScrollViewer currently allows two scrolling modes: smooth pixel-by-pixel scrolling (CanContentScroll = false) or discrete item-by-item scrolling (CanContentScroll = true). Currently WPF supports UI virtualization only when scrolling by item. Pixel-based scrolling is also called "physical scrolling" and item-based scrolling is also called "logical scrolling"."

虚拟化需要基于项目的滚动,因此它可以跟踪当前可见的逻辑单元(项目)...将ScrollViewer设置为基于像素的滚动,不再需要逻辑单元的概念,而只有像素!!!

Virtualization requires an item-based scrolling so it can keep track of logical units (items) currently in view... Setting the ScrollViewer to a pixel-based scrolling there is no more concept of logic units but only pixels!!!

这篇关于为什么将ScrollViewer.CanContentScroll设置为false会禁用虚拟化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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