RIA services and MVVM

Nov 24, 2011 at 6:23 AM

If I use RIA services, the client side classes already implement the necessary interfaces for MVVM (INotifyPropertyChanged,...).

I consider these classes as  my Model. The RIA services are quite specific to the use case they support so the types they use and return are also quite specific (they are NOT the Entity Framework classes from our data access layer).

Is it then, for the Catel framework, still required to, in the ViewModel, create individual properties tha map to individual properties of the Model classes? Or can I just create a Catel ViewModel class that has one property for the Model class and then do my databinding to the "ViewModel.Model.propertyX" path? Are there consequences to this "shortcut" ?


Nov 24, 2011 at 9:12 AM

The documentation contains an explanation of the different ways MVVM can be interepreted, and you are now using the "shortcut" way:

Different interpretations of MVVM

The documentation contains both advantages and disadvantages of both approaches. Since the entities contain the validation, it is possible to bind. However, you cannot interfere in the validation (thus not translate, change or add additional validations). Other than this, there are no disadvantages of your approach.