Как повернуть изображение вдоль оси X, а затем изменить его на другое, в WPF
I have an image that I want to rotate along the X axis and when the animation ends, I want to change it to another image.
This 04 second video is an example of what I intend to achieve
<a href="https://www.youtube.com/watch?v=gzyAemyU0Rs"></a>
What I have tried:
<pre lang="HTML"><Window.Resources>
<Style x:Key="AnimationImage" TargetType="{x:Type Image}">
<Setter Property="RenderTransform">
<Setter.Value>
<!--<RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />-->
<ScaleTransform ScaleX ="1" ScaleY ="1" CenterX="0.5" CenterY="0.5"/>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="true">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX"
From="1" To="-1" Duration="0:0:1" AutoReverse="False" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<StackPanel Margin="0,25,0,0">
<Button Name="buPrueba" Content="Rotar" Height="25" Width="150" HorizontalAlignment="Center" Click="buPrueba_Click"/>
<Image Name="imgPeru" Source="/Peru1.png" Height="150" Margin="0,25,0,0"/>
</StackPanel>
</Window>
private void buPrueba_Click(object sender, RoutedEventArgs e)
{
imgPeru.Style = FindResource("AnimationImage") as Style;
}