I am trying to figure out on how to trigger the PropertyChangedEvent when the middle layer of my binding changes. I will start with an example here:
public class MainViewModel :NotificationObject // Main DataContext { public SubViewModel SubVM{get; {_subVM = value; RaisePropertyChanged("SubVM");}} // observable property public void DoChangeSubVM() { SubVM = new SubViewModel(); // doing this will not update the egControl } } public class SubViewModel : NotificationObject { public Sub2ViewModel Sub2VM {get; set{_sub2VM = value; RaisePropertyChanged("Sub2VM");}} // observable property } public class Sub2ViewModel : NotificationObject { public int SomeProp {get; set {_someProp = value; RaisePropertyChanged("SomeProp");} // observable property } in the XAML:
<EgControl name="egControl" Content={Binding SubVM.Sub2VM.SomeProp} /> Now if I change the Sub2VM Property the egControl doesn't automagically get updated with the SomeProp value of the new Sub2VM instance. How does someone go about achieving this, with out manually having to raise all the Sub2ViewModel propertychanged events from Sub2VM property setter?
Using: Prism .NET 4.0