I have some properties in ViewModel that are updated/recalculated based on Model Properties updates. I am asking for the best approach to implement this scenario?
I don't like the approach of subscribing to PropertyChanged Event Handler of Model and then updating ViewModel properties. How do you handle this scenario?
Subscribing to events is the right approach, but I agree with you about not wanting to use the PropertyChanged event. I like to leave that event alone and create my own events as needed. Here is my approach:
In this example, Name and Age are observable for UI purposes, but Name is observable to anything outside of the UI. Now if you remove any PropertyChanged notifications, you don't accidentally cause that runtime error if your ViewModel was subscribed to PropertyChanged and parsing the string.