Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Silverlight
Silverlight 3
UIElement Class
 RenderTransform Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Silverlight 3

Other versions are also available for the following:
.NET Framework Class Library for Silverlight
UIElement..::.RenderTransform Property

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

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)
Visual Basic (Declaration)
Public Property RenderTransform As Transform
    Get
    Set
Visual Basic (Usage)
Dim instance As UIElement
Dim value As Transform

value = instance.RenderTransform

instance.RenderTransform = value
C#
public Transform RenderTransform { get; set; }
XAML Property Element Usage
<uiElement>
  <uiElement.RenderTransform>
    singleTransform
  </uiElement.RenderTransform>
</uiElement>

XAML Values

singleTransform

Exactly one object element for an object that derives from Transform. This is typically one of the transforms defined by Silverlight: RotateTransform, ScaleTransform, SkewTransform, TranslateTransform, MatrixTransform, TransformGroup. By using TransformGroup here, you can apply multiple transforms by defining child object elements of the TransformGroup. See "XAML Values" section for TransformGroup. Also, custom transforms might derive from MatrixTransform.

Property Value

Type: System.Windows.Media..::.Transform
Describes the specifics of the desired render transform. The default value is nullNothingnullptra null reference (Nothing in Visual Basic).

Dependency property identifier field: RenderTransformProperty

The Transform object can either be a single type of transform (such as RotateTransform) or a TransformGroup. The TransformGroup is not a transform per se, but is instead a container that enables you to specify more than one transform for a RenderTransform as markup children in XAML, or by adding transform items to the Children collection in code.

The local 0,0 for an object can be offset on a Canvas using Canvas..::.Left and Canvas..::.Top, but this does not count as a transform; the object retains its own local 0,0 in this case for transform purposes.

The render transform origin can also be offset with RenderTransformOrigin.

The following 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>
    <MatrixTransform>
      <MatrixTransform.Matrix >

        <!-- This matrix transforms the x,y position of
             the rectangle and skews it. -->
        <Matrix OffsetX="30" OffsetY="100" M12="0.5" />
      </MatrixTransform.Matrix>
    </MatrixTransform>
  </Rectangle.RenderTransform>

</Rectangle>

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker