A custom control (written under VS 2008) has a SelectedColor Dependency Property and its Control Template contains the following:
...
<Rectangle>
<Rectangle.Fill>
<SolidColorBrush Color="{TemplateBinding SelectedColor}"/>
</Rectangle.Fill>
</Rectangle>
...
The rectangle does not have the correct color unless the binding is repleaced with:
...
<Rectangle>
<Rectangle.Fill>
<SolidColorBrush Color="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}}"/>
</Rectangle.Fill>
</Rectangle>
...
OK, I am aware that TemplateBinding is a simplified version of Binding and it has a set of limitations, so what is the exact limitation that cause the above code not to work?