【发布时间】:2023-03-13 06:50:02
【问题描述】:
我正在尝试制作一个简单的动画 - 当鼠标光标位于按钮上时,我想在该按钮上添加模糊效果。
到目前为止,我有这个。:
<Button x:Name="button_Copy" Content="Leaderboard" HorizontalAlignment="Left" Margin="311,217,0,0" VerticalAlignment="Top" Width="139" Height="34" Background="{x:Null}" BorderBrush="{x:Null}" FontSize="22" FontWeight="Bold" Foreground="#FFE2DBDB" IsHitTestVisible="True" Click="button_Copy_Click">
<Button.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation From="10" To="0" Duration="0:0:0.1"
Storyboard.TargetName="blurEffect" Storyboard.TargetProperty="Radius"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
构建成功,但是当我将光标移到该按钮上时程序立即崩溃...知道如何解决这个问题吗?
【问题讨论】:
-
我们在这里缺少
blurEffect定义