I've consulted a number of sources on rotating an image using the WPF's declarative XAML format, namely, this pretty solid blog post, Rotate an Image in WPF Using Just XAML, and an SO question: wpf rotate image around center.
As a result, my XAML - which is rotating the image - looks like this:
<UserControl.Resources>
<Style x:Key="Spinner" TargetType="Image">
<Setter Property="Image.RenderTransform">
<Setter.Value>
<RotateTransform CenterX="13" CenterY="13" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetProperty="RenderTransform.Angle"
By="90"
To="360"
Duration="0:0:4"
RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
The problem I am having is that the rotation appears fluid and continuous, rather than by the 90 deg. specified by the By
property. I am attempting to rotate a particular portion of the image to a particular quadrant on each animation.
The answer, https://stackoverflow.com/a/23699219/3469725, gets close to what I need; however, the image is rotated once and is not continuously animated.
Is this possible with WPF and is the By
property the correct property to be using?