Situation:
I have a UserControl (call it UCA) with it’s DataContext bound to a ViewModel (call it VMA). The UserControl (UCA) has another UserControl (call it UCB) nested within and I have a ViewModel for UCB called VMB.
The parent ViewModel (VMA) has a property to instantiate VMB with the DataContext of UCB getting set to VMB.
When a control’s value (TextBox) changes in UCB which is bound to VMB, it gets notified (OnPropertyChanged). Now, I need that change in VMB to notified the “parent” VMA so the parent VMA can do some work and update controls in UCA.
So I’m on the ViewModel side, in my VMB OnPropertyChanged method and I’m trying to figure out how to bubble this data change up to VMA. Any suggestions? Hints?
Thanks, Rob.
Does VMA own VMB? Register the event in VMA
This shold work if VMB implements INotifyProeprtyChanged.