Dependency Properties and Routed Events are special WPF mechanisms that can be used in place of the CLR’s normal Properties and Events, since they are more powerful, although less typed. You can even define a dependency property or routed event without a matching property or event and one can access the property’s value or attach to the event using simple code.
However, it seems that what you can do in code, you can’t do in XAML. For instance, I have a control named Test, that has a property named MyProperty. If I decide against exposing it as a CLR property (maybe it only has meaning when used in WPF’s markup), I can still use this line to set it:
The above line compiles, runs and I’m a happy camper. However, try to get the following XAML to compile:
<local:Test x:Name="test" MyProperty="10" />
You’ll get: error MC3072: The property ‘MyProperty’ does not exist in XML namespace […]
So what this means is that without CLR properties exposing them, you can’t use dependency properties in XAML (the same is true for events and routed events).
It strikes me as odd that WPF’s XAML compiler can’t handle its own mechanism without requiring you to add more, unnecessary code.