Why use MVVM in a WPF + EF + C # application

1

I've researched a number of forums and articles, and everyone says that the MVVM standard should be used when working with a project with EF + WPF.

Can anyone tell me why this is so? because I want to implement a system but I do not know what would be the best architecture standard to use when it comes to Entity framework and WPF in C # language

    
asked by anonymous 31.03.2017 / 03:00

1 answer

1

You are not required to follow standards, but it is good practice to follow them.

MVVM, nothing else is a standard for the same purpose of the MVC, serves to separate responsibilities in layers. Model-View-ViewModel.

Model: Layer responsible for the Data Model ("table classes")

View: Presentation layer, layout, forms, screen

VieModel: Layer that communicates between Model and View. Where is the logic of the application, as if it were a business layer.

Not everything should be done in the ViewModel Layer, many things, mainly actions that affect the View layer, such as animations, layout changes etc., can be done in the View layer.

The advantage is ease of maintenance and application in other projects. For example, if developed for WPF (DeskTop), you can easily transfer to Windows Phone or Windows Modern Applications, changing only the View layer for each of the platforms, barely changing the other layers.

    
01.05.2017 / 22:34