I'm sure this has been solved before but I can't find a proper solution right know.. Probably I just don't know the terms I'm searching for.
Assuming I have this Custom Control Template
<Style x:Key="ColorPicker" TargetType="{x:Type local:ColorPicker}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:ColorPicker}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Thumb Width="30" Height="30" Canvas.Left="0" Canvas.Top="0">
<Thumb.Style>
<Style TargetType="Thumb">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Ellipse Fill="{TemplateBinding SelectedColor}" Width="30" Height="30" Stroke="Black" StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Thumb.Style>
</Thumb>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
where SelectedColor
is a Property of ColorPicker.
In the sample above, template binding would look for SelectedColor
in the template parent of type Thumb
, however how can i get a binding to the second level template parent?