wpf - MVVM:How am I supposed to convert a ViewModel into a Model? -


Everyone speaks about a model wrapping a model. Ok so far

But when I want to continue my model, how can I convert a view model into a model?

Reading all the models in a new model object seems very cumbersome.

Any better way?

I'm currently converting an old Winforms app into a wpf mvvm application, and I just I am providing a property on viewmodel which points to the actual example of the model.

From my point of view, it does not mean to make a replica of the model in the visual model, and I do not think the MVVM community is saying that.

This will not be particularly understood when you start using the Anti Framework or any other database orm, because the unit structure has properties which support the database outside the box. In addition, when you start making changes to the database, you will need to update the Model and View Models.

Edit: You are right that support in EF does not support INOptifyCollectionChanged, but as far as I know, support it supports INotifyPropertyChanged, and its About, Microsoft is thinking of implementing InotifyCollectionChanged in future releases.

I do not think there is a right or wrong way for MVVM - I think every different 'authority' on the Web has its own interpretation of how it should work.


Comments