代码如下,想实现鼠标放进去,阴影变多点,但是无效果,请大神指点下!
<Window x:Class="WpfApp3.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp3"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.Resources>
<Style x:Key="abc" TargetType="{x:Type Image}">
<Style.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="(DropShadowEffect.BlurRadius)" From="3" To="10"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid Background="#FFE2E2E2">
<Image Style="{StaticResource abc}" HorizontalAlignment="Left" Height="87.028" Margin="278.311,145.934,0,0" VerticalAlignment="Top" Width="148.585" Source="未标题-1.png">
<Image.Effect>
<DropShadowEffect x:Name="dse" Color="#FFC5C5C5" ShadowDepth="5" BlurRadius="3"/>
</Image.Effect>
</Image>
</Grid>
</Window>