Subscribe to INotifyPropertyChanged for nested (child) objects

后端 未结 6 1272
执念已碎
执念已碎 2020-12-04 22:05

I\'m looking for a clean and elegant solution to handle the INotifyPropertyChanged event of nested (child) objects. Example code:

<         


        
6条回答
  •  猫巷女王i
    2020-12-04 22:35

    I have been Searching the Web for one day now and I found another nice solution from Sacha Barber:

    http://www.codeproject.com/Articles/166530/A-Chained-Property-Observer

    He created weak references within a Chained Property Observer. Checkout the Article if you want to see another great way to implement this feature.

    And I also want to mention a nice implementation with the Reactive Extensions @ http://www.rowanbeach.com/rowan-beach-blog/a-system-reactive-property-change-observer/

    This Solution work only for one Level of Observer, not a full Chain of Observers.

提交回复
热议问题