Reputation: 45106
This will rotate the text like a clock
<DoubleAnimation Storyboard.TargetProperty="(TextBlock.RenderTransform).(RotateTransform.Angle)"
From="0" To="360" Duration="0:0:0.2" AutoReverse="True" RepeatBehavior="Forever"/>
How can I rotate the text in the horizontal plane (and see the mirror on the back side) ?
Also I want to rotate about the mid point so the text stays within the TextBlock.
Can this be done with a StoryBoard?
Upvotes: 1
Views: 269
Reputation: 17398
Not sure if I've got your requirement correctly,
but is this what your looking for?
If so you don't need the link in my comment tbh. You could just go with:
<Storyboard x:Key="SomeStoryboard"
AutoReverse="True"
RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="textBlock"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
<EasingDoubleKeyFrame KeyTime="0:0:1"
Value="-1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
...
<TextBlock x:Name="textBlock"
HorizontalAlignment="Left"
RenderTransformOrigin="0.5,0.5"
Text="Some random text">
<TextBlock.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform />
<TranslateTransform />
</TransformGroup>
</TextBlock.RenderTransform>
</TextBlock>
Upvotes: 2