Translates (moves) an object in the 2-D x-y coordinate system.
Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
defines an axis-aligned translation along the x- and y- axes. The following illustration shows the transformation matrix for a translation by offset (dx, dy).
Freezable Features: Because it inherits from the Freezable class, the class provides several special features: objects can be declared as resources, shared among multiple objects, made read-only to improve performance, cloned, and made thread-safe. For more information about the different features provided by Freezable objects, see Freezable Objects Overview.
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 RenderTransform property of an element, you can move an element within a StackPanel or DockPanel.
Use the X property of the to specify the amount, in pixels, to move the element along the x-axis. Use the Y property to specify the amount, in pixels, to move the element along the y-axis. Finally, apply the to the RenderTransform property of the element.
The following example uses a to move an element 50 pixels to the right and 50 pixels down.
For the complete sample, see 2-D Transforms Sample.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.