Page 1 of 1

Stopping a looping animation

Posted: 22 Dec 2013, 20:02
by Daki
I think I must be misunderstanding something basic because I am having difficulty stopping Storyboards that have their RepeatBehavior set to Forever.

When I call Stop() on the StoryBoard it doesn't seem to do anything. I also tried called Remove() after stopping it and that doesn't seem to do anything. After all that I checked IsPlaying() and it is returning true. The animations stop correctly in the XamlPlayer.

This must be a very simple thing to do, but I am at a loss.

Re: Stopping a looping animation

Posted: 24 Dec 2013, 17:34
by sfernandez
Only Storyboards that have been started with the IsControllable flag set to true can be paused, resumed or stopped.

This flag can be set to true when calling Storyboard.Begin():
storyboard->Begin(target, namescope, true, HandoffBehavior_SnapshotAndReplace);
Or if Storyboard is started by a BeginStoryboardAction, the action must have its Name property set:
<BeginStoryboard Name="CanvasAnimStart" Storyboard="{StaticResource CanvasAnim}"/>
If you are already following these stpes and you are unable to stop the animation it could be a bug, please report it in the bugtracker.

Re: Stopping a looping animation

Posted: 25 Dec 2013, 04:54
by Daki
Thanks, setting that flag true fixed my issue.