Let's say I've got a View. It's DataContext
is bound to a ViewModel
and the ViewModel
exposes a Model
property.
- Is it
MVVM
like to bind fields in theView
to properties in theModel
(e.g.Binding Path=Model.FirstName
)? - Should the
Model
implementINotifyPropertyChanged
?
My team are using Prism and MVVM in WPF. A lot of the Prism examples bind indirectly to the Model
. I personally have my doubts that this is the correct approach. I think stuff in the model should expose behaviour (not just at the property level) and should communicate important events by, er, event
s - that clients can subscribe to or not.
I think that by having domain/model objects implement INotifyPropertyChanged
somehow says to the world that it's UI/UX aware and kind of introduces some redundancy in the ViewModel
s.
What do you think? What works for you? A clear distinction between View
/ViewModel
/Model
or a hybrid as used by the Prism examples?