Trouble applying a simple template
Posted
by Adam S
on Stack Overflow
See other posts from Stack Overflow
or by Adam S
Published on 2010-05-24T15:08:58Z
Indexed on
2010/05/24
15:11 UTC
Read the original article
Hit count: 205
I'm having trouble applying a template to my checkboxes. I have the following template:
<ControlTemplate x:Key="TriStateRed" TargetType="{x:Type CheckBox}">
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="{x:Null}" >
<Setter TargetName="path" Property="Data" Value="M 0 2.5 A 5 2.5 0 1 1 5 5 L 5 8 M 5 10 L 5 10" />
<Setter TargetName="path" Property="Stroke" Value="Red" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
However, visual studio gives me the following error:
Cannot find the Trigger target 'path'. (The target must appear before any Setters, Triggers, or Conditions that use it.)
Can anyone make sense of this?
© Stack Overflow or respective owner