--- title: "How to: Animate an Object Along a Path (Double Animation)" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "animation [WPF], objects along paths (double animation)" - "double animation [WPF]" ms.assetid: 5a3c4a99-f303-42ad-a52a-e4794bb1798e --- # How to: Animate an Object Along a Path (Double Animation) This example shows how to use the class to move an object along a path defined by a . ## Example The following example uses two objects to move a rectangle along a geometric path: - The first animates the of the applied to the rectangle. It makes the rectangle move horizontally along the path. - The second animates the of the applied to the rectangle. It makes the rectangle move vertically along the path. [!code-xaml[PathAnimationGallery_snippet#DoubleAnimationUsingPathWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/PathAnimationGallery_snippet/CS/doubleanimationusingpathexample.xaml#doubleanimationusingpathwholepage)] [!code-csharp[PathAnimationGallery_procedural_snip#DoubleAnimationUsingPathWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/PathAnimationGallery_procedural_snip/CSharp/DoubleAnimationUsingPathExample.cs#doubleanimationusingpathwholepage)] [!code-vb[PathAnimationGallery_procedural_snip#DoubleAnimationUsingPathWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/PathAnimationGallery_procedural_snip/VisualBasic/DoubleAnimationUsingPathExample.vb#doubleanimationusingpathwholepage)] For the complete sample, see [Path Animation Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Animation/PathAnimations). Another way to move an object using a geometric path is to use a object. For an example, see [Animate an Object Along a Path (Matrix Animation)](how-to-animate-an-object-along-a-path-matrix-animation.md). ## See also - [Animation Overview](animation-overview.md) - [Path Animation How-to Topics](path-animation-how-to-topics.md)