Is there a more general concept or name for what WPF calls “dependency properties”? I imagine this is not a WPF-ism and in fact other libraries or frameworks have employed a similar approach? If so, what are these other instances and what are the similarities and differences compared to Microsoft’s dependency properties?
I am at a junction where I’m considering adding “dependency properties” to my own type system and object model (unrelated to WPF), as the construction seems appropriate for my design requirements; however, I want to consider what others have created as well, not just WPF’s particular implementation.
5
Dependency Properties are used whenever you need a binding mechanism, i.e. a way to reflect changes to a property onto another one.
This is very useful in XAML, where you can bind attributes in the markup (without using code) and let the DP mechanism handle that.
Since you are familiar with WPF, you already know that. But the additional step is that XAML can be used to represent different object models. Workflows, for example! Take a look at WF3 (the original Workflow Foundation framework, which shipped with .NET 3.0) to see how DP are used there, it shows you how they can work (rather well) outside of the WPF world.
NOTE: look specifically at WF3: as pointed out in the comments, WF4 is quite different (it uses InArguments and OutArguments to pass values between activities, and I have no idea how those are implemented under the cover). Also, note that WF3 is obsolete, it is only good to look at it for didactic purposes – which is what you are looking for, I suppose
2
I’m pretty sure dependency properties are unique for WPF (and derived frameworks like Silverlight and WinRT).
Before WPF, data binding was done mostly though specific interfaces and consumers. Eg. model implemented specific interface and UI control consumed this specific interface.
Also, I hate calling dependency property as “Data Binding”. I more prefer calling it “property (or data) synchronization”, because it is much precise description what the feature really does.