I want the image in the button to rotate +90 degrees or -90 degrees (dependent on the current angle) when the button is clicked. I tried a few solutions, but I only could make the whole button rotate instead of only the image inside it.
Here’s the code I have so far (style attributes etc. omitted for readability):
<Button Width="110">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Options" />
<Image RenderTransformOrigin="0.5, 0.5" Source="../../Images/gt.png">
<Image.RenderTransform>
<RotateTransform x:Name="AnimatedRotateTransform" Angle="0" />
</Image.RenderTransform>
<Image.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="AnimatedRotateTransform" Storyboard.TargetProperty="Angle" To="90" Duration="0:0:5" FillBehavior="Stop" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
</StackPanel>
</Button>
This is what the button looks like (the little arrow should point down when I click once, and then point right when I click again:

Anyone has an idea?
Edit: .NET 4.0, using Visual Studio 2010. Oh, and solving this "code-behind" is not an option.
The first thing to notice is that Image will never receive the Button.Click event, since it bubbles only to the button’s ancestors not to its descendents. To observe any effect, you’d need to trigger on e.g. MouseDown.
One way to achieve this effect would be to use a ToggleButton instead of a Button and modify its “pressed” state to rotate the arrow. Loosy, this would look like this: