Virtualizing WrapPanel for WP7

2019-04-15 19:32发布

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:

2条回答
Summer. ? 凉城
2楼-- · 2019-04-15 19:54

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.

查看更多
乱世女痞
3楼-- · 2019-04-15 20:00

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

查看更多
登录 后发表回答