Trouble applying a simple template
- by Adam S
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?