WPF Dependency Property Inheritance
I have a scenario in which DP Inheritance is not working, my code can also be wrong.
I have a Par开发者_如何学Pythonent control with a bool Dependency Property "CanShow" on ViewModel. This enables/disables the button on this MainParent Window.
Now, I want a property/DP on child VM, which can set the CanShow property of Parent from childVM to enable/disable the button.
Is this a scenario for Dependency Property Inheritance? - Plz suggest.
I hope so, the scenario is clear.
Thanks,
VJ
No, inheritance does not work from child to parent, it works from parent to child. You will have to use some sort of event aggregation in order to propagate your event from child to parent which will change CanShow.
精彩评论