I'm making a calendar using WPF with MVVM, I have a model for calendar entries and it also has a view model. I saw examples of INotifyDataErrorInfo and in some examples it was implemented in the model while in others it was in the view model. Does INotifyDataErrorInfo belong in the model or view model?
In the view model typically. But it depends on how you define view models and models. What you call a model may be seen as a view model and then you should implement the interface in this class.
The rule is that you should implement it in the class that you bind to in the view. So if you bind to properties of the Calendar
class, then implement it there. This effectively makes Calendar
a view model.
If Calendar
is some kind of domain object that you use across several different projects, you should consider creating a wrapper class (called CalendarViewModel
for example) and bind to this one instead of binding directly to the domain type.