cravie
cravie

Reputation: 35

Listbox not updating when field inside observablecollection is changed

I currently have an issue with my ObservableCollection that is databound to a listbox. Whenever I update a field inside of my ObservableCollection in the backend, the UI never refreshes, i have to null the list and reassign it to the binding for the UI to update. Any idea as to why this is happening? I've tried a lot of things but nothing changes. I'd rather not have to force the UI to update everytime I change a textfield inside of my collection.

Upvotes: 1

Views: 163

Answers (1)

Martin
Martin

Reputation: 5623

You have to implement INotifyPropertyChanged on the items of the collection, i.e. raise the PropertyChanged event when one of their properties changes.

ObservableCollection only notifies if an element is added or removed.

Upvotes: 5

Related Questions