Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-specify-handoffbehavior-between-storyboard-animations.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.0 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Specify HandoffBehavior Between Storyboard Animations 03/30/2017
Storyboards [WPF], handoff behavior between animations
animation [WPF], handoff behavior between
97bd6842-929b-49d9-813e-46553ae46472

How to: Specify HandoffBehavior Between Storyboard Animations

This example shows how to specify handoff behavior between storyboard animations. The xref:System.Windows.Media.Animation.BeginStoryboard.HandoffBehavior%2A property of xref:System.Windows.Media.Animation.BeginStoryboard specifies how new animations interact with any existing ones that are already applied to a property.

Example

The following example creates two buttons that enlarge when the mouse cursor moves over them and become smaller when the cursor moves away. If you mouse over a button and then quickly remove the cursor, the second animation will be applied before the first one is finished. It is when two animations overlap like this that you can see the difference between the xref:System.Windows.Media.Animation.BeginStoryboard.HandoffBehavior%2A values of xref:System.Windows.Media.Animation.HandoffBehavior.Compose and xref:System.Windows.Media.Animation.HandoffBehavior.SnapshotAndReplace. A value of xref:System.Windows.Media.Animation.HandoffBehavior.Compose combines the overlapping animations causing a smoother transition between animations while a value of xref:System.Windows.Media.Animation.HandoffBehavior.SnapshotAndReplace causes the new animation to immediately replace the earlier overlapping animation.

[!code-xamltimingbehaviors_snip#HandoffBehaviorWholePage]

See also