user25749
user25749

Reputation: 4905

How to Write a "Fake" ListBox

I use ListBox to show Images. However I found if the Listbox contain more than 1000 Image Items, It is really slow if I want to zoom the thumbnails. I asked the qestion in In a WPF ListBox with more than 1000 Image Items the Zoom Images become slow And tried lots of method, however I can't solve the problem by simply change the ListBox Property.

Can I write a fake ListBox? It seems contain lots of images, but actually it just contain about 100 images as its items, it can support smooth scrolling and when the 100 images are out of current window, it can load another 100 images while users do not know it(without pause when change page).

How do I write such a custom listbox?

Upvotes: 1

Views: 710

Answers (2)

rudigrobler
rudigrobler

Reputation: 17143

Read my response here. You need to implement a VirtualizingWrapPanel!

Upvotes: 3

Nick
Nick

Reputation: 13444

I have worked around a similar problem by doing one of:

  1. Provide a combo box to filter the list box. Very few people can efficiently find one thing in 300.
  2. Provide pagination on the list box. Put a label below that says "1 of x" and the standard back/forward button set.

Upvotes: 0

Related Questions