views:

11

answers:

1

I have a Listbox that I binds to a resource (sort) CollectionViewSource in my XAML. Then in my cs code I set the CollectionViewSource source to List of objects (class level field)

I then have "remove button" that checks the selected items in the Listbox and removes them from the List of objects (class level field).

I thought the Listbox should update automatically since the items source updated.

Am I missing a step or property setting ? Or am I missing something about how binding works?

tep

A: 

The class that contains your list of objects must implement INotifyPropertyChanged and you must raise the notification event when the list changes, passing in the name of the property that changed. This is what notifies the UI that it must update anything bound to that property.

Alternatively, make your collection of objects an ObservableCollection<T> and that will do the notifying for you.

Jay
Use the ObservableCollection since the objects (class) is share with a WCF service
codie