* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
2.8 KiB
title, ms.date, helpviewer_keywords, ms.assetid
| title | ms.date | helpviewer_keywords | ms.assetid | ||
|---|---|---|---|---|---|
| How to: Specify the FillBehavior for a Timeline that has Reached the End of Its Active Period | 03/30/2017 |
|
db805f59-d513-4dac-af15-47005dae3199 |
How to: Specify the FillBehavior for a Timeline that has Reached the End of Its Active Period
This example shows how to specify the xref:System.Windows.Media.Animation.Timeline.FillBehavior%2A for the inactive xref:System.Windows.Media.Animation.Timeline of an animated property.
Example
The xref:System.Windows.Media.Animation.Timeline.FillBehavior%2A property of a xref:System.Windows.Media.Animation.Timeline determines what happens to the value of an animated property when it is not being animated, that is, when the xref:System.Windows.Media.Animation.Timeline is inactive but its parent xref:System.Windows.Media.Animation.Timeline is inside its active or hold period. For example, does an animated property remain at its end value after the animation ends or does it revert back to the value it had before the animation started?
The following example uses a xref:System.Windows.Media.Animation.DoubleAnimation to animate the xref:System.Windows.FrameworkElement.Width%2A of two rectangles. Each rectangle uses a different xref:System.Windows.Media.Animation.Timeline object.
One xref:System.Windows.Media.Animation.Timeline has a xref:System.Windows.Media.Animation.Timeline.FillBehavior%2A that is set to xref:System.Windows.Media.Animation.FillBehavior.Stop, which causes the width of the rectangle to revert back to its non-animated value when the xref:System.Windows.Media.Animation.Timeline ends. The other xref:System.Windows.Media.Animation.Timeline has a xref:System.Windows.Media.Animation.Timeline.FillBehavior%2A of xref:System.Windows.Media.Animation.FillBehavior.HoldEnd, which causes the width to remain at its end value when the xref:System.Windows.Media.Animation.Timeline ends.
[!code-xamltimingbehaviors_snip#FillBehaviorWholePage]
For the complete sample, see Animation Example Gallery.
See also
- xref:System.Windows.Media.Animation.DoubleAnimation
- xref:System.Windows.FrameworkElement.Width%2A
- xref:System.Windows.Media.Animation.Timeline
- xref:System.Windows.Media.Animation.Timeline.FillBehavior%2A
- xref:System.Windows.Media.Animation.FillBehavior.Stop
- xref:System.Windows.Media.Animation.FillBehavior.HoldEnd
- Animation Overview
- Animation and Timing How-to Topics