0

I have implemented custom itempanel for gridview to support variable item height using this link posted by JerryNixon.My Custom panel supports 3 different sized template(depending on image dimension I am deciding which template to use).This custom Gridview should have pagination and it should support more than 200 items. Right now i could load only 50 items and it crashes because of out of memory exception event in 1GB device. Its one of the requirement in out project. I know when we implement custom itemspanel it losses default virtualization.

I have checked Pin.it app. They have implemented variable sized Gridview template and performance is very good, i could load more than 200 items.

Is there any way i can implement virtualization for my custom items panel? I have no idea how we can implement virtualization.If anyone has implemented it please give us some ideas how to get started with this so that it will help us a lot.

I dont think wrappanel code is required to post. If its required i ll post it.

Please give some suggestions. It will be very helpful :). Thanks :)

Archana
  • 3,213
  • 1
  • 15
  • 21

2 Answers2

0

To overcome out of memory exception just reduce the pixel width of the images and you will save the memory so that more items can be loaded in the page.

<Image Stretch="Uniform" Width="150" Height="170">
                        <Image.Source>
                            <BitmapImage UriSource="{Binding MainImage}" DecodePixelWidth="400"/>
                        </Image.Source>
                    </Image>

The above code does the trick.

Mohanvel V
  • 768
  • 4
  • 17
  • I do know this. When we give DecodePixelWidth less than what image already has. Image will be blurred. I want actual virtualization to be implemented,like reusing the views. Because microsoft is not providing this – Archana Sep 01 '16 at 11:46
0

Finally we implemented virtualized custom grdiview by referring to the code posted in this link. Code given in the link is for virtualizing horizontal gridview. I changed the code a bit to change it to vertical gridview. Many thanks to the person who posted the code. It helped a lot

Archana
  • 3,213
  • 1
  • 15
  • 21