0
votes

After Animation Starts in AnimationClock how we will control AutoReverse True/False in Int32Animation.

code Snippet. Int32Animation FrameAnimation; public void Load(){
FrameAnimation = new Int32Animation();
FrameAnimation.From = 1;
FrameAnimation.To = 100;

AnimationClock FrameAnimationClock = FrameAnimation.CreateClock();
ApplyAnimationClock(CurrentIndexProperty, FrameAnimationClock);

FrameAnimationClock.Controller.Begin();
}

public void AutoReverseButton_Click(object sender,EventArgs e){
FrameAnimation.AutoReverse = true;
}

If i click AutoReverseButton it is not setting the AutoReverse.But no errors. Let me know how we will achieve this.

-Britto

2

2 Answers

0
votes

This is because Animations are freezable objects. There is more information in the MSDN Documentation.

Once an animation is started, its properties cannot be changed, even in code-behind. You will need to stop the animation in your event handler, set the AutoReverse property, and restart it.

0
votes

Store the current Values in local Variables then Set the AutoReverse true/false then Create the Clock then Assign back the stored values in the AnimationClock.