Virtualizing WrapPanel for WP7

冷暖自知 提交于 2020-01-01 19:26:14

问题


I need to create a wrap panel with my facebook friends, meaning the itemcount is over 400, and it takes 5-10 seconds for all the items to load.

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

This code would be good, but it puts all the elements in 1 Row ...:

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

Any ideas how to add item wraping to VirtualizingStackPanel or how to add Virtualizing to a WrapPanel:


回答1:


Well, the whole point with the WrapPanel is that it adjusts to the size of the content. So it needs to render all items to determind the size.

So you're pretty much out of luck, when it comes to virtualizing that part. However, if it's 400 images you're loading, you could use the LowProfileImageLoader to improve the loading speed drastically.

You can find a mirror of the LowProfileImageLoader source code on my GitHub.




回答2:


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



来源:https://stackoverflow.com/questions/7978933/virtualizing-wrappanel-for-wp7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!