Gets or sets a value that specifies how the animation behaves after it reaches the end of its active period.
Assembly: System.Windows (in System.Windows.dll)
Dependency property identifier field: FillBehaviorProperty
Set an animations 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 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 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 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.
<Canvas> <Rectangle x:Name="MyAnimatedRectangle" Width="100" Height="100" Fill="Blue"> <Rectangle.Triggers> <!-- Animates the rectangle's opacity. --> <EventTrigger RoutedEvent="Rectangle.Loaded"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="MyAnimatedRectangle" Storyboard.TargetProperty="Opacity" From="1.0" To="0" Duration="0:0:5" FillBehavior="Stop" /> </Storyboard> </BeginStoryboard> </EventTrigger> </Rectangle.Triggers> </Rectangle> </Canvas>
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.