3
In the MVVM pattern where I must connect to the database, in View, Model or Viewmodel?
3
In the MVVM pattern where I must connect to the database, in View, Model or Viewmodel?
1
When you use the default MVVM, an application is divided into the following layers:
The model layer includes all the code that implements the application’s core logic and defines the types needed to model the application’s domain. This layer is completely independent of the view and view model layers.
The view layer defines the user interface using the declarative markup. Data binding markup defines the connection between the specific components of the user interface and multiple view model members (and sometimes model).
The view model layer provides data binding targets for the view layer. In many cases, view models expose the model layer directly or provide members that encapsulate specific members of the model layer. The view model layer can also set members to control data that is relevant to the user interface, but not to the model layer, such as the display order of a list of items
Soon the database related things should stay in the Model layer.
Browser other questions tagged c# wpf ms-access mvvm
You are not signed in. Login or sign up in order to post.