tags:

views:

34

answers:

1

Keep only ObservableCollections in the ViewModel and IEnumerables in the Model?

Does following this general guideline make any sense? I'm thinking this is the way to go because the models don't care about updating the View with the RaiseNotifyChanged.

+1  A: 

MSDN says:

You can enumerate over any collection that implements the IEnumerable interface. However, to set up dynamic bindings so that insertions or deletions in the collection update the UI automatically, the collection must implement the INotifyCollectionChanged interface.

I interpret that to mean the primary purpose for having an ObservableCollection is to provide better interaction with the collection in a user interface. From that perspective, ObservableCollections make sense in the ViewModel, but not the Model.

Robert Harvey