Código XAML
<Window.Triggers>
<EventTriggerRoutedEvent="Button.Click">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ThicknessAnimationStoryboard.TargetProperty="Margin">
<Duration="0:0:0.5"From="50,50,50,50"To="0,0,50,50"AutoReverse="True"/>
<DoubleAnimationStoryboard.TargetName="myDropShadowBitmapEffect">
<Storyboard.TargetProperty="ShadowDepth"From="0"To="30"Duration="0:0:0.5">
<AutoReverse="True"/>
<DoubleAnimationStoryboard.TargetName="myDropShadowBitmapEffect"
<Storyboard.TargetProperty="Softness"From="0"To="1"Duration="0:0:0.5"
<AutoReverse="True"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Window.Triggers>
<ButtonMargin="10"Width="225"Height="50"Name="myButton">
¡Click paracrear la sombra!
<Button.BitmapEffect>
<DropShadowBitmapEffectx:Name="myDropShadowBitmapEffect"Color="Black"
ShadowDepth="0"/>
</Button.BitmapEffect>
</Button>
No hay comentarios:
Publicar un comentario