Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Stopping a looping animation

22 Dec 2013, 20:02

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.
 
User avatar
sfernandez
Site Admin
Posts: 1912
Joined: 22 Dec 2011, 19:20

Re: Stopping a looping animation

24 Dec 2013, 17:34

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.
 
Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Re: Stopping a looping animation

25 Dec 2013, 04:54

Thanks, setting that flag true fixed my issue.

Who is online

Users browsing this forum: No registered users and 2 guests