我想在鼠标进入边框时为按钮阴影效果颜色设置动画。我尝试了这段代码,但对我不起作用。而且我不知道问题出在哪里?
<Style x:Name="HeaderButton" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Border" BorderBrush="#FF550211" BorderThickness="0" CornerRadius="4">
<Border.Triggers>
<EventTrigger RoutedEvent="Border.MouseEnter">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="Color" Storyboard.TargetName="MenuButtonShadow"
From="#FFFFFFFF" To="#FF000000" Duration="0:0:0.3"></ColorAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Border.Triggers>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFAF1232" Offset="0" />
<GradientStop Color="#FFB60329" Offset="1" />
</LinearGradientBrush>
</Border.Background>
<ContentPresenter Margin="8, 0" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect x:Name="MenuButtonShadow" ShadowDepth="0" BlurRadius="4"></DropShadowEffect>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="White"></Setter>
<Setter Property="Margin" Value="4"></Setter>
</Style>