문제

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 ?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top