Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Practice Observablecollection<Model> vs Observablecollection<ViewModel>

Which one is the better solution to hold my data or does it depends on some conditions?

sample situation 1:
you need to display a list of data which can be modified in an new window after selection.

sample situation 2:
you need to display a list of data which can be modified in this list.

like image 765
WiiMaxx Avatar asked May 15 '13 08:05

WiiMaxx


1 Answers

As you're using MVVM, you should be going with ObservableCollection<ViewModel>.

The Model should be separated from the View by means of the ViewModel.

like image 107
mattytommo Avatar answered Oct 21 '22 20:10

mattytommo