--- title: "How to: Accelerate or Decelerate an Animation" ms.date: "03/30/2017" helpviewer_keywords: - "decelerating animation [WPF]" - "accelerating animation [WPF]" - "animation [WPF], accelerating" - "animation [WPF], decelerating" ms.assetid: 4f383b2c-f94d-4a4e-9a06-f56f5dae95f9 --- # How to: Accelerate or decelerate an animation This example demonstrates how to make an animation accelerate and decelerate over time. In the following example, several rectangles are animated by animations with different and settings. ## Example [!code-xaml[timingbehaviors_snip#1](~/samples/snippets/csharp/VS_Snippets_Wpf/timingbehaviors_snip/CSharp/AccelDecelExample.xaml#1)] Code has been omitted from this example. For the complete code, see the [Animation Timing Behavior (C#)](https://github.com/dotnet/docs-desktop/tree/main/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/timingbehaviors_procedural_snip/CSharp) or [Animation Timing Behavior (Visual Basic)](https://github.com/dotnet/docs-desktop/tree/main/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/timingbehaviors_procedural_snip/visualbasic).