I get this error when I define my related dependency properties in a class outside the class hierarchy and set the owner to a common parent class.
Bound dependency property in the WindowBase class (external class hierarchy => generated error):
public static readonly DependencyProperty AreaColorProperty =
DependencyProperty.RegisterAttached("AreaColor", typeof(AreaColor), typeof(Window));
Template Error
{TemplateBinding local:WindowBase.AreaColor}
If instead I define an attached dependency property in a class inside the class hierarchy and set it for this class, then I get no errors, why is this?
A related dependency property in WindowBase (inside the class hierarchy => no errors):
public static readonly DependencyProperty AreaColorProperty =
DependencyProperty.RegisterAttached("AreaColor", typeof(AreaColor), typeof(WindowBase));
Regards, Jesper