tags:

views:

19

answers:

1

I have a ListView which i have binded with a List. If i add items to the List i must resize my window for the items to appear in my listview.

Any ideas?

+1  A: 

Make sure your list implements INotifyCollectionChanged. You may want to use ObservableCollection<T> here, as it makes this easy.

If you are binding to a standard List<T>, there is no way for the binding system to know that the list's contents have changed. My guess is that, when you resize the window, the list is rechecking the binding (in order to perform the new layout correctly), and capturing the new elements. Until you do this, the list's binding never refreshes. INotifyCollectionChanged will fix that.

Reed Copsey
I can't for some reason choose ObservableCollection from ObjectModel. See http://i47.tinypic.com/21b3gd3.jpg
Erik
Using Collection did not work.
Erik
I accidentally had the target framework for 3.5.
Erik