* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
2.9 KiB
title, ms.date, helpviewer_keywords, ms.assetid
| title | ms.date | helpviewer_keywords | ms.assetid | |||
|---|---|---|---|---|---|---|
| How to: Use Event Triggers to Control a Storyboard After It Starts | 03/30/2017 |
|
3b115594-6a93-4972-b24d-61aa16f1c15f |
How to: Use Event Triggers to Control a Storyboard After It Starts
This example shows how to control a xref:System.Windows.Media.Animation.Storyboard after it starts. To start a xref:System.Windows.Media.Animation.Storyboard by using [!INCLUDETLA2#tla_xaml], use xref:System.Windows.Media.Animation.BeginStoryboard, which distributes the animations to the objects and properties they animate and then starts the storyboard. If you give xref:System.Windows.Media.Animation.BeginStoryboard a name by specifying its xref:System.Windows.Media.Animation.BeginStoryboard.Name%2A property, you make it a controllable storyboard. You can then interactively control the storyboard after it starts.
Use the following storyboard actions together with xref:System.Windows.EventTrigger objects to control a storyboard.
-
xref:System.Windows.Media.Animation.PauseStoryboard: Pauses the storyboard.
-
xref:System.Windows.Media.Animation.ResumeStoryboard: Resumes a paused storyboard.
-
xref:System.Windows.Media.Animation.SetStoryboardSpeedRatio: Changes the storyboard speed.
-
xref:System.Windows.Media.Animation.SkipStoryboardToFill: Advances a storyboard to the end of its fill period, if it has one.
-
xref:System.Windows.Media.Animation.StopStoryboard: Stops the storyboard.
-
xref:System.Windows.Media.Animation.RemoveStoryboard: Removes the storyboard, freeing resources.
Example
The following example uses controllable storyboard actions to interactively control a storyboard.
Note
To see an example of controlling a storyboard by using code, see Control a Storyboard After It Starts Using Its Interactive Methods.
[!code-xamltimingbehaviors_snip#ControlStoryboardExampleUsingWholePage]
For additional examples, see the Animation Example Gallery.
See also
- xref:System.Windows.Media.Animation.ResumeStoryboard
- xref:System.Windows.Media.Animation.SetStoryboardSpeedRatio
- xref:System.Windows.Media.Animation.SkipStoryboardToFill
- xref:System.Windows.Media.Animation.PauseStoryboard
- xref:System.Windows.Media.Animation.StopStoryboard
- xref:System.Windows.Media.Animation.SeekStoryboard
- Control a Storyboard After It Starts Using Its Interactive Methods
- Animation Overview
- Storyboards Overview