Storyboard Storyboard Storyboard Class

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

Syntax

Declaration

public sealed class Storyboardpublic sealed class StoryboardPublic NotInheritable Class Storyboard
<Storyboard ...>
  oneOrMoreChildTimelines
</Storyboard>

Inheritance Hierarchy

Inherited Members

, , , , , , , , , , , , , , , , , , , , ,

Remarks

Storyboard is an important class in the concept of storyboarded animations. For more info on the concept, see Storyboarded animations.

Storyboard is used for these properties:

These properties aren't the only place where a Storyboard is defined. The typical way that a Storyboard is used for a storyboarded animation is that the Storyboard is defined in a Resources collection (either Resources or Resources, or possibly as a resource within a file such as Generic.xaml for a custom control). Whenever it's defined as a XAML resource, you should always assign an x:Name attribute value to your Storyboard. You can then reference the name as a programming variable later in code-behind. You'll need this reference to actually run the animations that the Storyboard contains, by calling the Begin() method on that Storyboard instance. Storyboard also has other control methods such as Stop() that can control the animation thereafter.

Storyboard inherits several properties from Timeline. These properties can be applied either to a Storyboard or to one of the animations within it (in the Children collection). There are pros and cons to setting Timeline properties on the main Storyboard instead of on each animation. For more info, see Storyboarded animations.

You also need a Storyboard in order to control the predefined animations that you add to controls or UI, if you are using one of the theme animations. Theme animations don't have an innate trigger point, so you need to contain theme animations in a Storyboard as the Children. If the Storyboard is used as the Storyboard value then the animation runs when that visual state is loaded. Or, if it's in a Storyboard, the animation runs when that transition is detected by the visual state manager. These are the most common way to use a theme animation, but you could also put one in a loose Storyboard resource and explicitly start the animation by calling Begin(). For more info on how to use theme animations, see Quickstart: Animating your UI using library animations or Storyboarded animations for visual states.

Storyboard XAML attached properties

Storyboard is the host service class for several XAML attached properties. Theses enable child animations under control by the Storyboard to each target separate target elements and target properties, while still following the same controlling timeline and triggering mechanism as the parent.

The XAML attached properties that are supported by Storyboard are:

  • TargetNameProperty
  • TargetPropertyProperty TargetNameProperty is used to reference another element by its name. The element being referenced is the element/object where the animation should apply. This mechanism is part of the basic design of the animation system: it enables animation resources to be declared separately from UI declaration resources, and makes it possible to apply one animation definition to several different property behaviors. For the value of TargetNameProperty on a particular animation, you specify the target element's Name or x:Name attribute value, which is a string. That named element should already exist in some other area of XAML markup.

The meaning of Name /x:Name attribute strings is controlled by a XAML namescope concept. For most animation targeting scenarios you won't need to worry about the influence of XAML namescopes, but you might encounter XAML name resolution issues if you're trying to target template parts, or objects that were created using Load(System.String) and subsequently added to the object tree. For more info, see XAML namescopes.

TargetPropertyProperty targets a particular property of the element as named by TargetNameProperty. The value you provide for TargetPropertyProperty involves a concept known as a property path. For more information on how to specify a property path for an animation, see Remarks in SetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline,System.String) or TargetPropertyProperty, or the Property-path syntax topic.

In order to support XAML processor access to the attached properties, and also to expose equivalent get and set operations to code, each XAML attached property has a pair of Get and Set accessor methods. For example, the GetTargetName(Windows.UI.Xaml.Media.Animation.Timeline) and SetTargetName(Windows.UI.Xaml.Media.Animation.Timeline,System.String) methods support and provide the equivalent code-only support for TargetNameProperty. Alternatively, you can use the dependency property system to get or set the value of the attached property. Call GetValue(Windows.UI.Xaml.DependencyProperty) or SetValue(Windows.UI.Xaml.DependencyProperty,System.Object), passing the arguments of the dependency property identifier to set, and a reference to the target object on which to get or set the value.

Examples

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.

<StackPanel x:Name="LayoutRoot" >
    <StackPanel.Resources>
        <Storyboard x:Name="myStoryboard">
            <DoubleAnimation From="1" To="6" Duration="00:00:6" 
            Storyboard.TargetName="rectScaleTransform" 
            Storyboard.TargetProperty="ScaleY">
                <DoubleAnimation.EasingFunction>
                    <BounceEase Bounces="2" EasingMode="EaseOut" 
                            Bounciness="2" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
    </StackPanel.Resources>

    <!-- Button that begins animation. -->
    <Button Click="Animation_Begin"
         Margin="2" Content="Begin" />

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

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

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

    <Rectangle Fill="Blue" Width="200" Height="30">
        <Rectangle.RenderTransform>
            <ScaleTransform x:Name="rectScaleTransform" />
        </Rectangle.RenderTransform>
    </Rectangle>

</StackPanel>
private void Animation_Begin(object sender, RoutedEventArgs e)
{
    myStoryboard.Begin();
}
private void Animation_Pause(object sender, RoutedEventArgs e)
{
    myStoryboard.Pause();
}
private void Animation_Resume(object sender, RoutedEventArgs e)
{
    myStoryboard.Resume();
}
private void Animation_Stop(object sender, RoutedEventArgs e)
{
    myStoryboard.Stop();
}
Private Sub Animation_Begin(sender As Object, e As RoutedEventArgs)
    myStoryboard.Begin()
End Sub

Private Sub Animation_Pause(sender As Object, e As RoutedEventArgs)
    myStoryboard.Pause()
End Sub

Private Sub Animation_Resume(sender As Object, e As RoutedEventArgs)
    myStoryboard.Resume()
End Sub

Private Sub Animation_Stop(sender As Object, e As RoutedEventArgs)
    myStoryboard.Stop()
End Sub
        //using Windows.UI.Xaml.Media.Animation;
        //using Windows.UI.Xaml.Shapes;
        //using Windows.UI

        private void Create_And_Run_Animation(object sender, RoutedEventArgs e)
        {
            // Create a red rectangle that will be the target
            // of the animation.
            Rectangle myRectangle = new Rectangle();
            myRectangle.Width = 200;
            myRectangle.Height = 200;
            SolidColorBrush myBrush = new SolidColorBrush(Colors.Red);
            myRectangle.Fill = myBrush;

            // Create the transform
            TranslateTransform moveTransform = new TranslateTransform();
            moveTransform.X = 0;
            moveTransform.Y = 0;
            myRectangle.RenderTransform = moveTransform;

            // Add the rectangle to the tree.
            LayoutRoot.Children.Add(myRectangle);

            // Create a duration of 2 seconds.
            Duration duration = new Duration(TimeSpan.FromSeconds(2));
            // Create two DoubleAnimations and set their properties.
            DoubleAnimation myDoubleAnimationX = new DoubleAnimation();
            DoubleAnimation myDoubleAnimationY = new DoubleAnimation();
            myDoubleAnimationX.Duration = duration;
            myDoubleAnimationY.Duration = duration;
            Storyboard justintimeStoryboard = new Storyboard();
            justintimeStoryboard.Duration = duration;
            justintimeStoryboard.Children.Add(myDoubleAnimationX);
            justintimeStoryboard.Children.Add(myDoubleAnimationY);
            Storyboard.SetTarget(myDoubleAnimationX, moveTransform);
            Storyboard.SetTarget(myDoubleAnimationY, moveTransform);

            // Set the X and Y properties of the Transform to be the target properties
            // of the two respective DoubleAnimations.
            Storyboard.SetTargetProperty(myDoubleAnimationX, "X");
            Storyboard.SetTargetProperty(myDoubleAnimationY, "Y");
            myDoubleAnimationX.To = 200;
            myDoubleAnimationY.To = 200;

            // Make the Storyboard a resource.
            LayoutRoot.Resources.Add("justintimeStoryboard", justintimeStoryboard);
            // Begin the animation.
            justintimeStoryboard.Begin();
        }
    ' need Imports for Windows.UI.Xaml.Shapes, Windows.UI.Media.Animation, Windows.UI
    Private Sub Create_And_Run_Animation(sender As Object, e As RoutedEventArgs)
        ' Create a red rectangle that will be the target
        ' of the animation.
        Dim myRectangle As Rectangle = New Rectangle
        myRectangle.Width = 200
        myRectangle.Height = 200
        Dim myBrush As SolidColorBrush = New SolidColorBrush(Colors.Red)
        myRectangle.Fill = myBrush

       ' Create the transform
        Dim moveTransform As TranslateTransform = New TranslateTransform
        moveTransform.X = 0
        moveTransform.Y = 0
        myRectangle.RenderTransform = moveTransform

        ' Add the rectangle to the tree.
        LayoutRoot.Children.Add(myRectangle)

        ' Create a duration of 2 seconds.
        Dim duration As Duration = New Duration(TimeSpan.FromSeconds(2))
        ' Create two DoubleAnimations and set their properties.
        Dim myDoubleAnimationX As DoubleAnimation = New DoubleAnimation
        Dim myDoubleAnimationY As DoubleAnimation = New DoubleAnimation
        myDoubleAnimationX.Duration = duration
        myDoubleAnimationY.Duration = duration
        Dim justintimeStoryboard As Storyboard = New Storyboard
        justintimeStoryboard.Duration = duration
        justintimeStoryboard.Children.Add(myDoubleAnimationX)
        justintimeStoryboard.Children.Add(myDoubleAnimationY)
        Storyboard.SetTarget(myDoubleAnimationX, moveTransform)
        Storyboard.SetTarget(myDoubleAnimationY, moveTransform)

        ' Set the X and Y properties of the Transform to be the target properties
        ' of the two respective DoubleAnimations.
        Storyboard.SetTargetProperty(myDoubleAnimationX, "X")
        Storyboard.SetTargetProperty(myDoubleAnimationY, "Y")
        myDoubleAnimationX.To = 200
        myDoubleAnimationY.To = 200

        ' Make the Storyboard a resource.
        LayoutRoot.Resources.Add("justintimeStoryboard", justintimeStoryboard)
        ' Begin the animation.
        justintimeStoryboard.Begin()
    End Sub

Constructors summary

Initializes a new instance of the Storyboard class.

Properties summary

Gets the collection of child Timeline objects.

Identifies the TargetNameProperty XAML attached property.

Identifies the TargetPropertyProperty XAML attached property.

Methods summary

Initiates the set of animations associated with the storyboard.

Gets the clock state of the Storyboard.

Gets the current animation clock time of the Storyboard.

Gets the value of the TargetNameProperty XAML attached property from a target element.

Gets the value of the TargetPropertyProperty XAML attached property from a target element.

Pauses the animation clock associated with the storyboard.

Resumes the animation clock, or run-time state, associated with the storyboard.

Moves the storyboard to the specified animation position. The storyboard performs the requested seek when the next clock tick occurs.

Moves the storyboard to the specified animation position immediately (synchronously).

Causes the specified Timeline to target the specified object.

Sets the value of the TargetNameProperty XAML attached property for a target element.

Sets the value of the TargetPropertyProperty XAML attached property for a target element.

Advances the current time of the storyboard's clock to the end of its active period.

Stops the storyboard.

Constructors

  • Storyboard()
    Storyboard()
    Storyboard()
    Storyboard()

    Initializes a new instance of the Storyboard class.

    public Storyboard()public Storyboard()Public Function Storyboard() As

Properties

  • Children
    Children
    Children
    Children

    Gets the collection of child Timeline objects.

    public TimelineCollection Children { get; }public TimelineCollection Children { get; }Public ReadOnly Property Children As TimelineCollection
    <Storyboard ...>
      oneOrMoreChildTimelines
    </Storyboard>
    

    Property Value

  • TargetNameProperty
    TargetNameProperty
    TargetNameProperty
    TargetNameProperty

    Identifies the TargetNameProperty XAML attached property.

    public static DependencyProperty TargetNameProperty { get; }public static DependencyProperty TargetNameProperty { get; }Public Static ReadOnly Property TargetNameProperty As DependencyProperty

    Property Value

  • TargetPropertyProperty
    TargetPropertyProperty
    TargetPropertyProperty
    TargetPropertyProperty

    Identifies the TargetPropertyProperty XAML attached property.

    public static DependencyProperty TargetPropertyProperty { get; }public static DependencyProperty TargetPropertyProperty { get; }Public Static ReadOnly Property TargetPropertyProperty As DependencyProperty

    Property Value

Methods

  • Begin()
    Begin()
    Begin()
    Begin()

    Initiates the set of animations associated with the storyboard.

    public void Begin()public void Begin()Public Function Begin() As void

    Remarks

    Calling this method begins all the animations that are in the Children collection of the Storyboard.

    Begin starts the animations within the Storyboard from their initial state, a clock time of zero. If you want to restart an animation where Pause() had been called previously, and continue on from the clock time where it was paused, use Resume() instead.

  • GetCurrentState()
    GetCurrentState()
    GetCurrentState()
    GetCurrentState()

    Gets the clock state of the Storyboard.

    public ClockState GetCurrentState()public ClockState GetCurrentState()Public Function GetCurrentState() As ClockState

    Returns

    Remarks

    This method is useful if you want to modify an animation's properties at runtime, before the animation is started. An animation that is stopped (GetCurrentState() returns ClockState.Stopped) can still be modified. An animation that is running (GetCurrentState() returns either ClockState.Active or ClockState.Filling) cannot be modified, and you'll get an error if you try.

    Windows 8 behavior

    An animation can have an optional BeginTime value, which modifies when the animation actually starts to affect values compared to when the controlling storyboard is started. Even if the running time has not reached the BeginTime yet, it's illegal to modify the properties of the animation once the storyboard starts it. For Windows 8, calling GetCurrentState() for a running animation where the running time has not reached the BeginTime always returns ClockState.Stopped. Normally, it's legal to modify a Stopped animation's properties, but in this particular case it's not, so using GetCurrentState() to determine whether it's legal to modify the animation is not always accurate. Starting with Windows 8.1, calling GetCurrentState() for an animation that's been started by its storyboard always returns ClockState.Active, even if the BeginTime value exists and hasn't been reached. The circumstances in which GetCurrentState() returns ClockState.Filling remain the same.

    Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.

  • GetCurrentTime()
    GetCurrentTime()
    GetCurrentTime()
    GetCurrentTime()

    Gets the current animation clock time of the Storyboard.

    public TimeSpan GetCurrentTime()public TimeSpan GetCurrentTime()Public Function GetCurrentTime() As TimeSpan

    Returns

  • GetTargetName(Windows.UI.Xaml.Media.Animation.Timeline)
    GetTargetName(Windows.UI.Xaml.Media.Animation.Timeline)
    GetTargetName(Windows.UI.Xaml.Media.Animation.Timeline)
    GetTargetName(Windows.UI.Xaml.Media.Animation.Timeline)

    Gets the value of the TargetNameProperty XAML attached property from a target element.

    public static string GetTargetName(Windows.UI.Xaml.Media.Animation.Timeline)public static string GetTargetName(Windows.UI.Xaml.Media.Animation.Timeline)Public Static Function GetTargetName(Windows.UI.Xaml.Media.Animation.Timeline) As string

    Parameters

    Returns

  • GetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline)
    GetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline)
    GetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline)
    GetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline)

    Gets the value of the TargetPropertyProperty XAML attached property from a target element.

    public static string GetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline)public static string GetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline)Public Static Function GetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline) As string

    Parameters

    Returns

  • Pause()
    Pause()
    Pause()
    Pause()

    Pauses the animation clock associated with the storyboard.

    public void Pause()public void Pause()Public Function Pause() As void
  • Resume()
    Resume()
    Resume()
    Resume()

    Resumes the animation clock, or run-time state, associated with the storyboard.

    public void Resume()public void Resume()Public Function Resume() As void
  • Seek(Windows.Foundation.TimeSpan)
    Seek(Windows.Foundation.TimeSpan)
    Seek(Windows.Foundation.TimeSpan)
    Seek(Windows.Foundation.TimeSpan)

    Moves the storyboard to the specified animation position. The storyboard performs the requested seek when the next clock tick occurs.

    public void Seek(Windows.Foundation.TimeSpan)public void Seek(Windows.Foundation.TimeSpan)Public Function Seek(Windows.Foundation.TimeSpan) As void

    Parameters

    • offset

      A positive or negative time value that describes the amount by which the timeline should move forward or backward from the beginning of the animation.

  • SeekAlignedToLastTick(Windows.Foundation.TimeSpan)
    SeekAlignedToLastTick(Windows.Foundation.TimeSpan)
    SeekAlignedToLastTick(Windows.Foundation.TimeSpan)
    SeekAlignedToLastTick(Windows.Foundation.TimeSpan)

    Moves the storyboard to the specified animation position immediately (synchronously).

    public void SeekAlignedToLastTick(Windows.Foundation.TimeSpan)public void SeekAlignedToLastTick(Windows.Foundation.TimeSpan)Public Function SeekAlignedToLastTick(Windows.Foundation.TimeSpan) As void

    Parameters

    • offset

      A positive or negative time value that describes the amount by which the timeline should move forward or backward from the beginning of the animation.

  • SetTarget(Windows.UI.Xaml.Media.Animation.Timeline,Windows.UI.Xaml.DependencyObject)
    SetTarget(Windows.UI.Xaml.Media.Animation.Timeline,Windows.UI.Xaml.DependencyObject)
    SetTarget(Windows.UI.Xaml.Media.Animation.Timeline,Windows.UI.Xaml.DependencyObject)
    SetTarget(Windows.UI.Xaml.Media.Animation.Timeline,Windows.UI.Xaml.DependencyObject)

    Causes the specified Timeline to target the specified object.

    public static void SetTarget(Windows.UI.Xaml.Media.Animation.Timeline,Windows.UI.Xaml.DependencyObject)public static void SetTarget(Windows.UI.Xaml.Media.Animation.Timeline,Windows.UI.Xaml.DependencyObject)Public Static Function SetTarget(Windows.UI.Xaml.Media.Animation.Timeline,Windows.UI.Xaml.DependencyObject) As void

    Parameters

  • SetTargetName(Windows.UI.Xaml.Media.Animation.Timeline,System.String)
    SetTargetName(Windows.UI.Xaml.Media.Animation.Timeline,System.String)
    SetTargetName(Windows.UI.Xaml.Media.Animation.Timeline,System.String)
    SetTargetName(Windows.UI.Xaml.Media.Animation.Timeline,System.String)

    Sets the value of the TargetNameProperty XAML attached property for a target element.

    public static void SetTargetName(Windows.UI.Xaml.Media.Animation.Timeline,System.String)public static void SetTargetName(Windows.UI.Xaml.Media.Animation.Timeline,System.String)Public Static Function SetTargetName(Windows.UI.Xaml.Media.Animation.Timeline,System.String) As void

    Parameters

    • element

      The target element to set the value for.

    • name
      System.String
      System.String
      System.String

      The TargetNameProperty value of the target element to set. This should correspond to an existing Name or x:Name value on the UI element that the animation targets.

  • SetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline,System.String)
    SetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline,System.String)
    SetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline,System.String)
    SetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline,System.String)

    Sets the value of the TargetPropertyProperty XAML attached property for a target element.

    public static void SetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline,System.String)public static void SetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline,System.String)Public Static Function SetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline,System.String) As void

    Parameters

    • element

      The target element for which to set the value.

    • path
      System.String
      System.String
      System.String

      The TargetPropertyProperty value of the target element to set. This specifies a qualification path that targets the dependency property where the animation applies. See Remarks.

    Remarks

    Using SetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline,System.String) in code as opposed to targeting an animation in initial XAML definitions is rare. It's tricky to get all the targeting and timing correct in an animation, particularly if you're trying to incorporate values that are only available at run time. We recommend that you create your animations in XAML, which means you'll use the TargetPropertyProperty attached property, not the SetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline,System.String) runtime method (which supports the XAML behind the scenes). Building up animations in code is an advanced scenario. Here's a very basic code example of what's involved:```csharp Rectangle rect = new Rectangle(); rect.RenderTransform = new ScaleTransform(); //TODO - connect this Rectangle to the visual tree Storyboard storyboard = new Storyboard(); DoubleAnimation scalex = new DoubleAnimation() { From = 0, To = 8, AutoReverse = true, Duration = TimeSpan.FromSeconds(2) }; Storyboard.SetTargetProperty(scalex, "(Rectangle.RenderTransform).(ScaleTransform.ScaleX)"); Storyboard.SetTarget(scalex, rect); //TODO - Begin the animation

    
    
    
    ### Property paths for animation property targeting
    
    The @Windows.UI.Xaml.Media.Animation.Storyboard.TargetPropertyProperty attached property is typically set on the individual @Windows.UI.Xaml.Media.Animation.Timeline -derived animations that make up the @Windows.UI.Xaml.Media.Animation.Storyboard.Children collection of an animation definition in XAML.
    
    The @Windows.UI.Xaml.Media.Animation.Storyboard.TargetNameProperty property can process a string syntax that enables targeting a subproperty of a property value. The syntax uses a "dot-down" metaphor for targeting a chain of object-property relationships until a particular subproperty is identified. This enables animations to apply to the value types where there is a supporting animation structure ([Double](https://msdn.microsoft.com/library/system.double.aspx), @Windows.UI.Color, [Point](http://msdn.microsoft.com/library/0cdd5b17-2f7e-4e17-896c-7d7784c8643d), and [Object](https://msdn.microsoft.com/library/system.object.aspx) for @Windows.UI.Xaml.Media.Animation.DiscreteObjectKeyFrame.#ctor ). For example, you might want to animate the @Windows.UI.Xaml.Controls.Control.Background value of a @Windows.UI.Xaml.Controls.Control, which takes an object type of @Windows.UI.Xaml.Media.Brush. There is no "BrushAnimation" animation type, so you cannot directly target an animation for @Windows.UI.Xaml.Controls.Control.Background . But what you can do instead is reference a @Windows.UI.Xaml.Media.SolidColorBrush subproperty that is named @Windows.UI.Xaml.Media.SolidColorBrush.Color, which takes type @Windows.UI.Color and can thus be targeted by a @Windows.UI.Xaml.Media.Animation.ColorAnimation. The string syntax for this is:
    
    ```xaml
    (Control.Background).(SolidColorBrush.Color)
    

    The parentheses around "(Control.Background)" inform the processing that the intermediate "dot" should not "dot down" and is instead part of the qualification name that finds the ownertype-qualified Background property for targeting. The following "dot" is treated as a "dot-down" instruction, which requests a subproperty of the Brush type. The final "(SolidColorBrush.Color)" fragment again includes the parentheses so that the interior "dot" is again used as ownertype.member qualification, not a "dot-down".

    Note that for subproperty values, there can be some value inference. For example, the following string works by inference even though "Color" is actually a value of the particular Brush subclass SolidColorBrush:

    (Control.Background).Color
    

    There is a lot more to property path specification than this. This remark is just intended to get you started with the basic targeting scenarios. For more info, see Property-path syntax and Storyboarded animations.

    Migration notes

    When you specify a path value for the path parameter, you specify the string, and if you retrieve the value again using GetTargetProperty(Windows.UI.Xaml.Media.Animation.Timeline), you also get the value as a string. This is in contrast to some other implementations of animation property targeting concepts such as Microsoft Silverlight and Windows Presentation Foundation (WPF). These XAML technologies use a representative object type (a discrete PropertyPath object) to store the property path information for animation targeting, and the syntax for the SetTargetProperty methods use the PropertyPath type. The Windows Runtime also has a PropertyPath class; however that class is only used for data binding, which is another scenario for property path definitions. The Windows Runtime doesn't support modifying a property path in a Storyboard after it's defined using the string, so its implementation of TargetPropertyProperty takes a string. This distinction doesn't even matter for XAML syntax and attached property support. It only matters for creating dynamic storyboards in code, or programmatically modifying storyboard values after they are initially defined in XAML. If you have any need to retarget an animation to a different property at run time, create an entirely new Storyboard with the new property path string, run animations with the new Storyboard, and stop using the previous one.

  • SkipToFill()
    SkipToFill()
    SkipToFill()
    SkipToFill()

    Advances the current time of the storyboard's clock to the end of its active period.

    public void SkipToFill()public void SkipToFill()Public Function SkipToFill() As void

    Remarks

    If you call this method on an animation that doesn't have a FillBehavior value of HoldEnd, this has the same effect as calling Stop().

    This method is mainly relevant for methods that are playing or paused, and which don't have infinite repeat. Calling SkipToFill() on an infinite animation or an animation that's already stopped has no effect.

  • Stop()
    Stop()
    Stop()
    Stop()

    Stops the storyboard.

    public void Stop()public void Stop()Public Function Stop() As void

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.UI.Xaml.Markup.ContentPropertyAttribute

Details

Assembly

Windows.UI.Xaml.Media.Animation.dll