0

Well, i want house image to rotate from -5° to and i wrote the following code

 Duration duration2 = new Duration(TimeSpan.FromSeconds(1)); Storyboard sb2 = new Storyboard(); sb2.Duration = duration2; DoubleAnimation da2 = new DoubleAnimation(); da2.Duration = duration2; sb2.Children.Add(da2); RotateTransform rt2 = new RotateTransform(); Storyboard.SetTarget(da2, rt2); Storyboard.SetTargetProperty(da2, new PropertyPath("Angle")); da2.From = 5; da2.To = -5; HouseImg.RenderTransform = rt2; HouseImg.RenderTransformOrigin = new Point(0.5, 0.5); sb2.RepeatBehavior = RepeatBehavior.Forever; sb2.Begin(); 

But when it ends it goes rapidly to the beginning() and what i want is to animate that also. So to conclude: i want to animate from to -5° AND from -5° to also.

Tnx :)

1 Answer 1

1

Set the AutoReverse property to true.

sb2.AutoReverse = true; 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.