I have a WPF ListBox with its ItemsSource bound to an ObservableCollection navigation property on an Entity Framework 4 POCO proxy. I want the user to be able to add and remove items to/from the list and then commit those changes by clicking on a [Save] button.
It mostly works, but the ListBox does not show added items until ObjectContext.CommitChanges() is called. It seems that the POCO proxy is intercepting the event for Action.Add operations and then, upon commit, reraising it or maybe a Action.Reset event.
Does anyone know if this is the case. Any possible workarounds to get the desired behavior?
More than likely it’s something else; if at the base the property is a collection which implements INotifyCollectionChanged, nothing can stop anybody from subscribing to that event (it’s not like routed events or anything). In my experience I never had problems with the proxy properties generated at runtime, at least. Look at how your collection is initialized and double-check your bindings, I’d say.