MVVM where does the code to load the data belong?

Posted by cody on Stack Overflow See other posts from Stack Overflow or by cody
Published on 2010-05-21T04:23:44Z Indexed on 2010/05/21 4:30 UTC
Read the original article Hit count: 232

Filed under:
|

As I wrap my head around the mvvm thing, the view is the view, and the viewmodel is 'a modal of a view' and the model are the entities we are dealing with (or at least that is my understanding). But I'm unclear as to what and when the model entities are populated. So for example:

Lets say I have app that needs to create a new record in a DB. And that record should have default values to start with. Who is responsible for the new record, and getting the default values. Does this have anything to do with MVVM or is that part of a data access layer? Who calls the the viewmodel?

Or for existing records when\where are the records retrieved? And saved if altered?

Thanks

© Stack Overflow or respective owner

Related posts about mvvm

Related posts about wpf