Question

I know that the Windows Phone 7 ListBox use VirtualizingStackPanel by default to optimize memory.

However, when I add more items to the view model, the listbox doesnot show those new items. I must scroll up, then down to see them.

My view model does implement IList

Many articles around have this problem, like this guide

How to fix this ?

Était-ce utile?

La solution

Does you viewmodel implement the INotifyPropertyChanged interface and raise the PropertyChanged event when you've added more items?

A better solution is to make the viewmodel property you bind against an ObservableCollection. This class will automatically raise the PropertyChanged event when items are added/removed from the collection.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top