The things which are supposed to go into the Model are also allowed to go into the View-Model i.e. Public Properties, IDataErroInfo and INotifyPropertyChanged, then what should actually go into the model?
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
- How to properly change a resource dictionary
Assume you are going to write a batch process for a data load. The batch process will only access the model, thus everything you need to process the business rules divorced from the UI belongs in the model. The ViewModel may have some business rules but only as they pertain to the UI.
In the application I am building, the Views and ViewModels are in one assembly and the Model in another. The model has no references to the View's assembly and only the Model assembly has references to the underlying data store (a combination of Linq and web service calls).
Model
View
ViewModel
1)
IDataErrorInfo
- Should go intoViewModel
2)
INotifyPropertyChanged
- Should go intoViewModel
, andModel
(if needed, not recommended for Model)3)
Public Properties
- Yes of course aModel
should have them.