Código XAML
<Window.Resources>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="true">
<Setter Property = "BitmapEffect">
<Setter.Value>
<DropShadowBitmapEffect Color="Black" Direction="320"
ShadowDepth="25" Softness="1" Opacity="0.5"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Window.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="myAnimatedButton"
Storyboard.TargetProperty="(Button.RenderTransform).(RotateTransform.Angle)" RepeatBehavior="1x" From="0"
To="360" Duration="0:0:1" ></DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="myAnimatedButton"
Storyboard.TargetProperty="(Button.RenderTransform).(RotateTransform.Angle)" RepeatBehavior="1x" From="360"
To="0" BeginTime="0:0:1" Duration="0:0:1"
></DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Window.Triggers>
<Grid>
<Button Name="myAnimatedButton" Height="60" Width="120"
RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center"
HorizontalAlignment="Center">
¡Click Aquí!
<Button.RenderTransform>
<RotateTransform Angle="0" />
</Button.RenderTransform>
</Button>
</Grid>
No hay comentarios:
Publicar un comentario