Dears,
I have this image:
<Image Classes="Rotating" Source="/Assets/icon_gear.png" />
and I want it to start spinning right after the window is shown. So I've followed this: http://avaloniaui.net/docs/animations/keyframe
I've added this Style:
<UserControl.Styles>
<Style Selector="Image.Rotating">
<Style.Animations>
<Animation Duration="0:0:5">
<KeyFrame Cue="0%">
<Setter Property="**Angle???**" Value="0"/>
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="**Angle???**" Value="360"/>
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
</UserControl.Styles>
As you see, I don't know which Property to set so that it can spin.
In "classic" XAML, one way it to use Storyboards: https://stackoverflow.com/a/12298305/901046
But I don't see them in Avalonia...
Try doing RotateTransform.Angle , all four built-in transforms (ScaleTransform,RotateTransform,TranslateTransform & SkewTransform) are invokable in animations. There's an sample project in the repo so do check it out for later reference.
Also we don't use any Storyboard, but we follow CSS more closely on this regard (same goes with styles).
Aaaaand it works! 馃
Most helpful comment
Try doing
RotateTransform.Angle, all four built-in transforms (ScaleTransform,RotateTransform,TranslateTransform&SkewTransform) are invokable in animations. There's an sample project in the repo so do check it out for later reference.Also we don't use any Storyboard, but we follow CSS more closely on this regard (same goes with styles).