Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Does LongListSelector support Data Virtualization? I read on several Blogs that it does, but can't get it to work.

Here is what I tried: I provided a IList implementation as ItemsSource to the List. The problem is that the List calls GetEnumerator() instead of this[int index] to get a list item.

So my question: How do I implement data virtualization for LongListSelector?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
371 views
Welcome To Ask or Share your Answers For Others

1 Answer

As you said, the LongListSelector is still based around GetEnumerator even for when rendering IList types. Most likely the control would need to be rewritten to support the purpose. While blogs might say it support it, none of them says how, so I'm not inclined to believe them. The LongListSelector's default is to render all items.

As for the loading of the data, it can be done progressive using a ObservableCollection. I got a example project that shows how to use a ObservableCollection in combination with the LongListSelector.

Basically this could allow you to progressively add more groups and/or, more data to the groups, and the UI should update accordingly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...