--- title: "How to: Translate an Element" ms.date: "03/30/2017" helpviewer_keywords: - "graphics [WPF], translations" ms.assetid: 461c8273-15df-42f6-8672-89ba22887cc0 --- # How to: Translate an Element This example shows how to translate (move) an element by using a . The class is especially useful for moving elements inside panels that do not support absolute positioning. For example, by applying a to the property of an element, you can move an element within a or . Use the property of the to specify the amount, in pixels, to move the element along the x-axis. Use the property to specify the amount, in pixels, to move the element along the y-axis. Finally, apply the to the property of the element. The following example uses a to move an element 50 pixels to the right and 50 pixels down. ## Example [!code-xaml[transformsSample#53](~/samples/snippets/csharp/VS_Snippets_Wpf/transformsSample/CS/TranslateTransformExample.xaml#53)] For the complete sample, see [2D Transforms Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Graphics/2DTransforms). ## See also - [Transforms Overview](transforms-overview.md)