如何获得水平虚拟化ListBox? [英] How can I get a horizontal virtualizing ListBox?

查看:129
本文介绍了如何获得水平虚拟化ListBox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从MSDN中,我发现ListBox使用VirtualizingStackPanel作为默认ItemsPanelTemplate.默认的堆栈面板是垂直的,在我的项目中,我需要一个水平的面板.因此,我设置了ItemsPanel属性:

From MSDN, I found that ListBox uses a VirtualizingStackPanel as the default ItemsPanelTemplate. The default stackpanel is vertical, in my project I need a horizontal one. So, I set the ItemsPanel property:

<ListBox.ItemsPanel>
    <ItemsPanelTemplate>
        <StackPanel Orientation="Horizontal"/>
    </ItemsPanelTemplate>
</ListBox.ItemsPanel>



是的,它可以工作,但是我发现虚拟化功能已禁用.当我将10000个项目绑定到ListBox时,UI需要5秒钟来加载数据.显然,这很糟糕.

我不知道为什么有人可以帮忙吗?非常感谢.



Yes, it works, but I find the virtualizing feature is disabled. When I bind 10000 items to the ListBox, the UI take 5 seconds to load data. Obviously, it''s terrible.

I don''t know why. Can someone help? I appreciate very much.

推荐答案

您好,发现了一些可能有用的链接.

http://bea.stollnitz.com/blog/?p=411 [ http://bea.stollnitz.com/files/52/DataVirtualization.pdf [ ^ ]

http://bea.stollnitz.com/blog/?p=378 [ WPF:数据虚拟化 [
Hi, found a few links which might be helpful.

http://bea.stollnitz.com/blog/?p=411[^]

http://bea.stollnitz.com/files/52/DataVirtualization.pdf[^]

http://bea.stollnitz.com/blog/?p=378[^]

WPF: Data Virtualization[^]


这篇关于如何获得水平虚拟化ListBox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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