I try to implement lazy "load more" elements when the user falls to the bottom of the list, but every time I try to add new elements to the list, I get the following results:
"The operation is not supported in the read-only collection.
I have already tried several solutions on the forums on blogs that don't seem to work. I can't even understand the logic behind the problem, which seems a little strange to me.
What I am doing is basically loading a list of items and assigning my list items as a source.
wineFilterListBox.ItemsSource = wines;
When the user gets to the bottom of the list, I add more elements (like the twitter application for wp7)
public ObservableCollection<Wine> wines; ... if (atBottom) { int Count = page.wineFilterListBox.Items.Count; int end = Count + 10; for (int i = Count; i < end; i++) { page.LoadWineList(Count); } } ... private void LoadWineList(int Count = 1) { ... wineFilterListBox.Items.Add(wines); }
Bruno faria
source share