ObservableCollections in ViewModel and IEnumerables in Models?

Keep only ObservableCollections in ViewModel and IEnumerables in Model?

Does it make sense to follow this general guideline? I think this is the way to go because the models don't care about updating the view with RaiseNotifyChanged.

+2


a source to share


1 answer


MSDN says:

You can list any collection that implements the IEnumerable

interface. However, to configure dynamic linking so that inserts or deletions in the collection UI are automatic, the collection must be implemented INotifyCollectionChanged

.



I am interpreting this to mean that the main goal ObservableCollection

is to provide a better user interface with the collection. From this point of view, ObservableCollections make sense in ViewModel

, but not in Model

.

+1


a source







All Articles