Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Storyboard>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="grid">
- <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
- <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="60"/
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- var turnSB = new Storyboard();
- var doubleAnim = new DoubleAnimationUsingKeyFrames();
- doubleAnim.KeyFrames.Add(new EasingDoubleKeyFrame() { KeyTime = TimeSpan.FromMilliseconds(0), Value = currentAngle });
- doubleAnim.KeyFrames.Add(new EasingDoubleKeyFrame() { KeyTime = TimeSpan.FromMilliseconds(500), Value = targetAngle });
- turnSB.Children.Add(doubleAnim);
- Storyboard.SetTarget(doubleAnim, this.RenderTransform);
- Storyboard.SetTargetProperty(doubleAnim, "(CompositeTransform.Rotation)");
- turnSB.Begin();
- Storyboard.SetTargetProperty(doubleAnim, "(UIElement.RenderTransform).(CompositeTransform.Rotation)");
- Storyboard.SetTarget(doubleAnim, this.RenderTransform);
- Storyboard.SetTargetProperty(doubleAnim, "Rotation"); // maybe "CompositeTransform.Rotation"
- storyboard.Children.Add(doubleAnim);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement