LeeCampbell / RxCookbook

Collection of recipes and snippets helping you create useful Rx code
281 stars 39 forks source link

Deep property change notification with the Switch operator #9

Open LeeCampbell opened 10 years ago

LeeCampbell commented 10 years ago

Either show how to build a query that allows a user to observe ObjA.PropB.SubPropC by leaveraging Switch e.g.

ObjA.WhenPropertyChanges(vm=>vm.PropB)
    .Select(b=>b.WhenPropertyChanges(vm=>vm.SubPropC))
    .Switch()  

We could potentially extend this to build an Expression builder so you could just

ObjA.WhenPropertyChanges(vm=>vm.PropB.SubPropC)