Stopping a looping animation
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.
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.
-
-
sfernandez
Site Admin
- Posts: 3222
- Joined:
Re: Stopping a looping animation
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():
Or if Storyboard is started by a BeginStoryboardAction, the action must have its Name property set:
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.
This flag can be set to true when calling Storyboard.Begin():
Code: Select all
storyboard->Begin(target, namescope, true, HandoffBehavior_SnapshotAndReplace);
Code: Select all
<BeginStoryboard Name="CanvasAnimStart" Storyboard="{StaticResource CanvasAnim}"/>
Re: Stopping a looping animation
Thanks, setting that flag true fixed my issue.
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 3 guests