列表框中的UI虚拟化以及Scrollviewer [英] UI Virtualization in Listbox along with Scrollviewer

查看:53
本文介绍了列表框中的UI虚拟化以及Scrollviewer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用C#开发一个都市风格的应用程序,该应用程序中的一个页面有数据绑定,从数据库中拉出大约20,000条记录,然后显示在ListBox中放入Scrollviewer。

I am developing a metro style app in C# and a page in that app has data binding which pulls out say 20,000 records or so from database and then displays it in ListBox which is put inside the Scrollviewer.

我需要在此上下文中实现UI虚拟化。

I need to achieve UI Virtualization here in this context.

约束:我不希望我的itemcontrol明确设置高度/宽度来实现UI虚拟化。

Constraint : I don't want my itemcontrol to set explicitly height/width to achieve UI virtualization here.

我提到了一些资源和修改我的.xaml如下。

I have referred to few resources and modified my .xaml as follows.

- > 删除了ListBox上方的ScrollViewer

->Removed ScrollViewer which is above the ListBox

- > Set VirtualizingStackPanel.VirtualizationMode =" Recycling"在ListBox中

->Set VirtualizingStackPanel.VirtualizationMode="Recycling" in ListBox

- > 在ListBox控件内添加了以下xaml。 / span>

 <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
                <VirtualizingStackPanel />
            </ItemsPanelTemplate>
 </ListBox.ItemsPanel>

我想知道这些修改是否正确无法实现Metro应用程序中的UI虚拟化或者除了这些更改之外还有什么必须完成吗?还有其他任何在地铁中实现UI虚拟化的建议。

I wish to know whether these modifications are correct to achieve UI Virtualization in Metro app or does anything has to be done other than these changes?Any other suggestions to achieve UI Virtualization in metro is also appreciated.

我想知道如何确保UI虚拟化已经实现?(任何证明UI已启用虚拟化的证据)

I wish to know How can I be get assured  that UI Virtualization has been achieved?(Any proof to witness that UI Virtualization has been enabled)

Subramanian Muthukrishnan

Subramanian Muthukrishnan

推荐答案

你能告诉我们这个ListBox的用途吗? (顺便说一句,你应该使用ListView)
Can you give us an idea of where this ListBox would be used? (btw, you should use a ListView instead)


这篇关于列表框中的UI虚拟化以及Scrollviewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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