--- title: "How to: Animate a Popup" ms.date: "03/30/2017" helpviewer_keywords: - "Popup control [WPF], animating" - "animation [WPF], Popup controls" ms.assetid: acaa2a0a-6137-4efd-9cd1-75ece222e390 --- # How to: Animate a Popup This example shows two ways to animate a control. ## Example The following example sets the property to a value of , which causes the to "slide-in" when it appears. In order to rotate the , this example assigns a to the property on the , which is the child element of the . For the transform to work correctly, the example must set the property to `true`. In addition, the on the content must specify enough space for the to rotate. [!code-xaml[AnimatedPopup#RotateTransform2](~/samples/snippets/csharp/VS_Snippets_Wpf/AnimatedPopup/CS/Window1.xaml#rotatetransform2)] The following example shows how a event, which occurs when a is clicked, triggers the that starts the animation. [!code-xaml[AnimatedPopup#RotateTransform1](~/samples/snippets/csharp/VS_Snippets_Wpf/AnimatedPopup/CS/Window1.xaml#rotatetransform1)] ## See also - - - - - - [How-to Topics](popup-how-to-topics.md) - [Popup Overview](popup-overview.md)