wpfxamlfont-awesome

WPF Icon to spin


based on this answer i have two questions:

  1. Whats the name of the marked icon?

enter image description here

  1. How can I make it to raotate to the other direction, i.e to spin like:

enter image description here

Itried to add FlowDirection="RightToLeft" like:

<fa:ImageAwesome FlowDirection="RightToLeft" SpinDuration="6" Icon="Cog" Width="200" Height="200" Foreground="White" Spin="True" />

but it still rotate to same direction


Solution

  • this should do the trick for you:

    enter image description here

    <Grid Background="White">
        <Viewbox Height="30" Width="30" Stretch="Fill">
            <Path Stretch="Fill" Stroke="Black" StrokeThickness="8" Fill="Transparent" Data="M 50,10 A 40,40 0 1 1 90.45,29.55" RenderTransformOrigin="0.5,0.5">
                <Path.RenderTransform>
                    <RotateTransform/>
                </Path.RenderTransform>
                <Path.Style>
                    <Style>
                        <Style.Triggers>
                            <Trigger Property="Image.IsEnabled" Value="True">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.Angle" From="0" To="360" Duration="0:0:1"        RepeatBehavior="Forever" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Path.Style>
            </Path>
        </Viewbox>
    </Grid>