Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-accumulate-animation-values-during-repeat-cycles.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* 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
2020-09-04 09:46:28 -07:00

2.9 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Accumulate Animation Values During Repeat Cycles 03/30/2017
accumulating animation values across repeating cycles [WPF]
animation [WPF], accumulating values across repeating cycles
548df369-c7cc-4dab-b569-08b95ced2e7e

How to: Accumulate Animation Values During Repeat Cycles

This example shows how to use the xref:System.Windows.Media.Animation.DoubleAnimation.IsCumulative%2A property to accumulate animation values across repeating cycles.

Example

Use the xref:System.Windows.Media.Animation.DoubleAnimation.IsCumulative%2A property to accumulate base values of an animation across repeating cycles. For example, if you set an animation to repeat 9 times (xref:System.Windows.Media.Animation.Timeline.RepeatBehavior%2A = "9x") and you set the property to animate between 10 and 15 (From = 10 To = 15), the property animates from 10 to 15 during the first cycle, from 15 to 20 during the second cycle, from 20 to 25 during the third cycle, and so on. Hence, each animation cycle uses the ending animation value from the previous animation cycle as its base value.

You can use the IsCumulative property with most basic animations and most key frame animations. For more information, see Animation Overview and Key-Frame Animations Overview.

The following example shows this behavior by animating the width of four rectangles. The example:

[!code-xamltimingbehaviors_snip#IsCumulativeWholePage]

See also