1

我需要和我的 facebook 朋友一起创建一个包装面板,这意味着 itemcount 超过 400,加载所有项目需要 5-10 秒。

   <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <toolkit:WrapPanel/>
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>

这段代码很好,但它将所有元素放在 1 Row ...:

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

任何想法如何将项目包装添加到 VirtualizingStackPanel 或如何将虚拟化添加到 WrapPanel:

4

2 回答 2

0

I used it by creating a simple listbox, with each element containing a stackpanel with 4 images. cheers

于 2011-12-19T09:54:59.487 回答
0

嗯,WrapPanel 的重点在于它可以根据内容的大小进行调整。所以它需要渲染所有项目来确定大小。

因此,在虚拟化该部分时,您几乎不走运。但是,如果您正在加载 400 张图像,则可以使用LowProfileImageLoader大幅提高加载速度。

您可以在我的 GitHub 上找到 LowProfileImageLoader 源代码的镜像。

于 2011-11-02T12:36:01.143 回答