The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Storyboard Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Controls animations with a timeline, and provides object and property targeting information for its child animations.

Namespace:  System.Windows.Media.Animation
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

[ContentPropertyAttribute("Children", true)]
public sealed class Storyboard : Timeline
<Storyboard ...>

XAML Values


One or more object elements for classes that derive from Timeline. This can be either another Storyboard or any of a number of animation types.

The Storyboard type exposes the following members.

Public methodStoryboardInitializes a new instance of the Storyboard class.

Public propertyAutoReverseGets or sets a value that indicates whether the timeline plays in reverse after it completes a forward iteration. (Inherited from Timeline.)
Public propertyBeginTimeGets or sets the time at which this Timeline should begin. (Inherited from Timeline.)
Public propertyChildrenGets the collection of child Timeline objects.
Public propertyDispatcherGets the Dispatcher this object is associated with. (Inherited from DependencyObject.)
Public propertyDurationGets or sets the length of time for which this timeline plays, not counting repetitions. (Inherited from Timeline.)
Public propertyFillBehaviorGets or sets a value that specifies how the animation behaves after it reaches the end of its active period. (Inherited from Timeline.)
Public propertyRepeatBehaviorGets or sets the repeating behavior of this timeline. (Inherited from Timeline.)
Public propertySpeedRatioGets or sets the rate, relative to its parent, at which time progresses for this Timeline. (Inherited from Timeline.)

Public attached propertyTargetNameGets or sets the name of the object to animate.
Public attached propertyTargetPropertyGets or sets the name of the property that should be animated.

Public methodBeginInitiates the set of animations associated with the storyboard.
Public methodCheckAccessDetermines whether the calling thread has access to this object. (Inherited from DependencyObject.)
Public methodClearValueClears the local value of a dependency property. (Inherited from DependencyObject.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetAnimationBaseValueReturns any base value established for a Windows Phone dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)
Public methodGetCurrentStateGets the clock state of the storyboard.
Public methodGetCurrentTimeGets the current time of the storyboard.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodStatic memberGetTargetNameGets the TargetName of the specified Timeline object.
Public methodStatic memberGetTargetPropertyGets the TargetProperty of the specified Timeline object.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetValueReturns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodPausePauses the animation clock associated with the storyboard.
Public methodReadLocalValueReturns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)
Public methodResumeResumes the animation clock, or run-time state, associated with the storyboard.
Public methodSeekMoves the storyboard to the specified animation position. The storyboard performs the requested seek when the next clock tick occurs.
Public methodSeekAlignedToLastTickMoves the storyboard to the specified animation position immediately (synchronously).
Public methodStatic memberSetTargetCauses the specified Timeline to target the specified object.
Public methodStatic memberSetTargetNameCauses the specified Timeline to target the object with the specified name.
Public methodStatic memberSetTargetPropertyCauses the specified Timeline to target the specified dependency property.
Public methodSetValueSets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)
Public methodSkipToFillAdvances the current time of the storyboard's clock to the end of its active period.
Public methodStopStops the storyboard.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Public eventCompletedOccurs when the Storyboard object has completed playing. (Inherited from Timeline.)

Public fieldStatic memberTargetNamePropertyIdentifies the TargetName attached property.
Public fieldStatic memberTargetPropertyPropertyIdentifies the TargetProperty attached property.

You can think of a Storyboard as a container for other animation objects (for example, a DoubleAnimation) as well as other Storyboard objects. In other words, you can nest Storyboard objects within each other and specify BeginTime values for each Storyboard separately. Using nested storyboards can help you orchestrate elaborate animation sequences. Each child Storyboard waits until its parent Storyboard begins and then starts the countdown before it in turn begins.

You can use the interactive methods of the Storyboard object to start, pause, resume, and stop an animation. For more information, see Animations, motion, and output for Windows Phone.


Do not attempt to call Storyboard members (for example, Begin) within the constructor of the page. This will cause the animation to fail silently.

The following example shows how to use the Begin, Stop, Pause, and Resume methods to control the playback of a storyboard (animation). A set of buttons allow the user to call these methods.

<phone:PhoneApplicationPage x:Class="interactive_animation.Page"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" mc:Ignorable="d" xmlns:d="" xmlns:mc="" d:DesignHeight="800" d:DesignWidth="480">
        <TextBlock Margin="10" TextWrapping="Wrap">This sample uses the Begin, Pause, Resume, and Stop methods to control an animation.</TextBlock>
                <Storyboard x:Name="myStoryboard">

                    <!-- Animate the center point of the ellipse. -->
                    <PointAnimation Storyboard.TargetProperty="Center"
          RepeatBehavior="Forever" />

            <Path Fill="Blue">
                    <!-- Describes an ellipse. -->
                    <EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
          Center="20,20" RadiusX="15" RadiusY="15" />

            <StackPanel Orientation="Horizontal" Canvas.Left="0" Canvas.Top="265">
                <!-- Button that begins animation. -->
                <Button Click="Animation_Begin"
        Content="Begin" />

                <!-- Button that pauses Animation. -->
                <Button Click="Animation_Pause"
        Content="Pause" />

                <!-- Button that resumes Animation. -->
                <Button Click="Animation_Resume"
        Content="Resume" />

                <!-- Button that stops Animation. Stopping the animation returns the
        ellipse to its original location. -->
                <Button Click="Animation_Stop"
        Content="Stop" />


private void Animation_Begin(object sender, RoutedEventArgs e)
private void Animation_Pause(object sender, RoutedEventArgs e)
private void Animation_Resume(object sender, RoutedEventArgs e)
private void Animation_Stop(object sender, RoutedEventArgs e)

The following example shows how to create a Storyboard using code.

private void Create_And_Run_Animation(object sender, EventArgs e)
    // Create a red rectangle that will be the target
    // of the animation.
    Rectangle myRectangle = new Rectangle();
    myRectangle.Width = 200;
    myRectangle.Height = 200;
    Color myColor = Color.FromArgb(255, 255, 0, 0);
    SolidColorBrush myBrush = new SolidColorBrush();
    myBrush.Color = myColor;
    myRectangle.Fill = myBrush;

    // Add the rectangle to the tree.

    // Create a duration of 2 seconds.
    Duration duration = new Duration(TimeSpan.FromSeconds(2));

    // Create two DoubleAnimations and set their properties.
    DoubleAnimation myDoubleAnimation1 = new DoubleAnimation();
    DoubleAnimation myDoubleAnimation2 = new DoubleAnimation();

    myDoubleAnimation1.Duration = duration;
    myDoubleAnimation2.Duration = duration;

    Storyboard sb = new Storyboard();
    sb.Duration = duration;


    Storyboard.SetTarget(myDoubleAnimation1, myRectangle);
    Storyboard.SetTarget(myDoubleAnimation2, myRectangle);

    // Set the attached properties of Canvas.Left and Canvas.Top
    // to be the target properties of the two respective DoubleAnimations.
    Storyboard.SetTargetProperty(myDoubleAnimation1, new PropertyPath("(Canvas.Left)"));
    Storyboard.SetTargetProperty(myDoubleAnimation2, new PropertyPath("(Canvas.Top)"));

    myDoubleAnimation1.To = 200;
    myDoubleAnimation2.To = 200;

    // Make the Storyboard a resource.
    LayoutRoot.Resources.Add("unique_id", sb);

    // Begin the animation.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.