This example shows how to use code to control a Storyboard after it has started. To control a storyboard in XAML, use Trigger and TriggerAction objects; for an example, see How to: Use Event Triggers to Control a Storyboard After It Starts.
To start a storyboard, you use its Begin method, which distributes the storyboard's animations to the properties they animate and starts the storyboard.
To make a storyboard controllable, you use the Begin method and specify true as the second parameter. You can then use the storyboard's interactive methods to pause, resume, seek, stop, speed up, or slow down the storyboard, or advance it to its fill period. The following is a list of the storyboard's interactive methods:
Pause: Pauses the storyboard.
Resume: Resumes a paused storyboard.
SetSpeedRatio: Sets the storyboard's interactive speed.
Seek: Seeks the storyboard the specified location.
SeekAlignedToLastTick: Seeks the storyboard to the specified location. Unlike the Seek method, this operation is processed before the next tick.
SkipToFill: Advances the storyboard to its fill period, if it has one.
Stop: Stops the storyboard.
In the following example, several storyboard methods are used to interactively control a storyboard.
Note: To see an example of controlling a storyboard using triggers with XAML, see How to: Use Event Triggers to Control a Storyboard After It Starts.