Referring to question: (Is there a pattern for subscribing to hierarchical property changes with Reactive UI?)
I currently have a child reactiveobject in my parent reactiveobject.
public class Child : ReactiveObject
{
private string propertyX
public string PropertyX
{
get { return this.propertyX; }
set { this.RaiseAndSetIfChanged(x => x.PropertyX, ref this.propertyX, value); }
}
private string propertyY
public string PropertyY
{
get { return this.propertyY; }
set { this.RaiseAndSetIfChanged(x => x.PropertyY, ref this.propertyY, value); }
}
}
public class Parent: ReactiveObject
{
public Parent(Child child)
{
Child = child;
this.WhenAny(x => x.Child.PropertyX, x => x.Value).Subscribe(x => raisePropertyChanged("Child"));
}
private Child child
public Child Child
{
get { return this.child; }
set { this.RaiseAndSetIfChanged(x => x.Child, ref this.child, value); }
}
}
My question is that do I have to write:
this.WhenAny(x => x.Child.PropertyX, x => x.Value).Subscribe(x => raisePropertyChanged("Child"));
for each child property?
The reason I need to do this is because my DevExpress grid will not update because of the nested property binding.
<dxg:GridColumn x:Key="PropertyX" Header="PropertyX" FieldName="Child.PropertyX" />