直接上效果图,在需要使用的控件上给定
<DockPanel HorizontalAlignment="Left" Margin="0 32 0 0" Style="{StaticResource UIElementHover}">
<Border Width="120" Height="120" CornerRadius="120" Style="{StaticResource UIElementHover}">
<TextBlock FontSize="20" Text="DaskBoard" FontWeight="Bold" Style="{StaticResource UIElementHover}"></TextBlock>
<Style x:Key="UIElementHover" TargetType="FrameworkElement">
<Setter Property="RenderTransformOrigin" Value="0.5,0.5">
</Setter>
<Setter Property="Cursor" Value="Hand">
</Setter>
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1" ScaleY="1"/>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
BeginTime="00:00:00" Duration="00:00:01"
To="1.2"
>
<DoubleAnimation.EasingFunction>
<PowerEase Power="1" EasingMode='EaseIn'></PowerEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
BeginTime="00:00:00" Duration="00:00:01"
To="1.2" >
<DoubleAnimation.EasingFunction>
<PowerEase Power="1" EasingMode='EaseIn'></PowerEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
BeginTime="00:00:00" Duration="00:00:01"
>
<DoubleAnimation.EasingFunction>
<PowerEase Power="1" EasingMode='EaseOut'></PowerEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
BeginTime="00:00:00" Duration="00:00:01"
>
<DoubleAnimation.EasingFunction>
<PowerEase Power="1" EasingMode='EaseInOut'></PowerEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</Style.Triggers>
</Style>