我想重新设计我的ToggleButton。我在xaml:中创建ToggleButton
<ToggleButton Width="15" Grid.Column="2" />
并且在参考资料中有ToggleButton样式:
<Style TargetType="ToggleButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Path Name="Arrow" Fill="Black" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z" />
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="Arrow" Property="Data" Value="M 0 4 L 4 0 L 8 4 Z" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
当我试图构建时,我遇到了这个错误:
在类型上找不到模板属性"IsChecked"System.Windows.Controls.Control".
我该如何解决这个问题?
给ControlTemplate
TargetType
太
<ControlTemplate TargetType="ToggleButton">