What's the difference between
{TemplateBinding Foreground}
and
{Binding Path=Foreground, RelativeSource={RelativeSource TemplatedParent}}
?
Why does code below throw
{"Cannot convert the value in attribute 'Value' to object of type ''. Error at object 'System.Windows.Setter'."}
?
I'm using June CTP 6.0.5456.3.0.
<Window ...>
<Window.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Name="Border" Background="{TemplateBinding Background}"/>
<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Border" Property="Background"
Value="{TemplateBinding Foreground}"/> <!-- Here -->
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Button Background="Green" Foreground="Red">Click Me</Button>
</Window>