动画对象不能用于动画属性“BorderThickness”,因为它是不兼容的类型
“System.Windows.Media.Animation.DoubleAnimation”动画对象不能用于动画属性“BorderThickness”,因为它是不兼容的类型“System.Windows.Thickness”。
<Style TargetType="{x:Type local:ImageButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<Border x:Name="border" BorderBrush="Blue" BorderThickness="0">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="0.5" Duration="0:0:1" AutoReverse="False"
Storyboard.TargetName="border"
Storyboard.TargetProperty="(Border.BorderThickness)"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="0" Duration="0:0:1" AutoReverse="False"
Storyboard.TargetName="border"
Storyboard.TargetProperty="(Border.BorderThickness)"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>