FillBehavior Property
Collapse the table of content
Expand the table of content

Timeline.FillBehavior Property

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

Gets or sets a value that specifies how the animation behaves after it reaches the end of its active period.

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

public FillBehavior FillBehavior { get; set; }
<timeline FillBehavior="HoldEnd"/>
<timeline FillBehavior="Stop"/>

Property Value

Type: System.Windows.Media.Animation.FillBehavior
A value that specifies how the timeline behaves after it reaches the end of its active period but its parent is inside its active or fill period. The default value is HoldEnd.

Dependency property identifier field: FillBehaviorProperty

Set an animations FillBehavior property to HoldEnd when you want the animation to hold its value after it reaches the end of its active period. An animation that has reached the end of its active period that has a FillBehavior setting of HoldEnd is said to be in its fill period. When you don't want an animation to hold its value after it reaches the end of its active period, set its FillBehavior property to Stop.

A child timeline stops playing and filling when its parent timeline stops; if you want a child timeline to fill, make sure its parent timeline has a FillBehavior of HoldEnd.

The filling behavior can create the illusion that a property is unsettable at runtime if you are not careful about stopping unintended animations. Attempting to change the animated value coming from a filling animation in code will appear to have no effect until the filling animation is stopped.

The following example uses the non-default FillBehavior value of Stop. As a result, the Opacity value of the rectangle reverts to 1 after the animation ends.


      <!-- Animates the rectangle's opacity. -->
      <EventTrigger RoutedEvent="Rectangle.Loaded">
              From="1.0" To="0" Duration="0:0:5" FillBehavior="Stop" />

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft