Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-make-an-element-spin-in-place.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

23 lines
1.4 KiB
Markdown

---
title: "How to: Make an Element Spin in Place"
ms.date: "03/30/2017"
helpviewer_keywords:
- "graphics [WPF], spinning elements"
- "spinning elements [WPF]"
ms.assetid: 1f011976-8b07-4c31-9faf-019e0ddaa24c
---
# How to: Make an Element Spin in Place
This example shows how to make an element spin by using a <xref:System.Windows.Media.RotateTransform> and a <xref:System.Windows.Media.Animation.DoubleAnimation>.
The following example applies the <xref:System.Windows.Media.RotateTransform> to the <xref:System.Windows.UIElement.RenderTransform%2A> property of the element. The example uses a <xref:System.Windows.Media.Animation.DoubleAnimation> to animate the <xref:System.Windows.Media.RotateTransform.Angle%2A> of the <xref:System.Windows.Media.RotateTransform>. To make the element spin in place, the example sets the <xref:System.Windows.UIElement.RenderTransformOrigin%2A> property of the element to the point (0.5, 0.5).
## Example
[!code-xaml[transformanimations_snip#11](~/samples/snippets/xaml/VS_Snippets_Wpf/transformanimations_snip/XAML/RotateAboutCenterExample.xaml#11)]
For the complete sample, which includes more transformation examples, see [2D Transforms Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Graphics/2DTransforms).
## See also
- [Animation Overview](animation-overview.md)
- [Transforms Overview](transforms-overview.md)