Timeline.FillBehavior Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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)


Public Property FillBehavior As FillBehavior
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 nondefault 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" />

Version Information


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0


For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.