UIElement.RenderTransform Property

Definition

Gets or sets transform information that affects the rendering position of a UIElement.

C#
public Transform RenderTransform { get; set; }
XAML
<uiElement>
  <uiElement.RenderTransform>
    singleTransform
  </uiElement.RenderTransform>
</uiElement>

Property Value

Describes the specifics of the desired render transform. The default value is null.

Examples

This XAML defines a Matrix that provides data for a MatrixTransform applied to a rectangular shape as its RenderTransform. In this case, the matrix combines an offset (OffsetX and OffsetY) and a skew (M12). Note that this same effect could have been produced by combining a TranslateTransform and a SkewTransform; whether to use a single Matrix or combinations of discrete transforms (with TransformGroup) is a matter of coding style; the results are identical.

XAML
<Rectangle Width="60" Height="60" Fill="Blue">
  <Rectangle.RenderTransform>
    <!-- This matrix transforms the x,y position of the rectangle and skews it. -->
    <MatrixTransform Matrix="1,0.5,0,1,30,100"/>
  </Rectangle.RenderTransform>
</Rectangle>

Remarks

You can animate a transform, if you target sub-properties of the specific transform being used that take Double values. Or you can use ObjectAnimationUsingKeyFrames to cycle through distinct transforms. Classes such as QuarticEase show some example XAML.

If you do animate RenderTransform, make sure there is an existing starting Transform value, even if it is all at default values. You can't animate a RenderTransform value that is initially null.

The value of RenderTransform is overridden by PointerDownThemeAnimation and PointerUpThemeAnimation.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also