I have a ListView which I have bound 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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.INotifyCollectionChangedwill fix that.