TransformGroup

Represents a composite Transform composed of other Transform objects.

XAML
<TransformGroup>
  oneOrMoreTransforms
</TransformGroup>
Scripting
To create an object using scripting, see CreateFromXAML.

XAML Values

oneOrMoreTransforms One or more object elements that derive from Transform. These can be one or more of the following: RotateTransform, ScaleTransform, SkewTransform, TranslateTransform, MatrixTransform, TransformGroup. Object elements defined here become members of the collection held by the Children property, when accessed by scripting at runtime.

Properties

Children, Name

Methods

Equals, FindName, GetHost, GetValue, SetValue

Remarks

Use a TransformGroup when you want to apply multiple Transform objects to a single property.

In a composite transformation, the order of individual transformations is important. For example, if you first rotate, then scale, then translate, you get a different result than if you first translate, then rotate, then scale. One reason order is significant is that transformations such as rotation and scaling are done with respect to the origin of the coordinate system. Scaling an object that is centered at the origin produces a different result than scaling an object that has been moved away from the origin. Similarly, rotating an object that is centered at the origin produces a different result than rotating an object that has been moved away from the origin.

In XAML usages, TransformGroup uses Children as its content property and supports implicit collection usage. Therefore, to declare transforms that will be in a TransformGroup in XAML, you declare one or more transforms as object elements, placing them in order as the child elements of the TransformGroup. Nesting TransformGroups is permitted.

Examples

The following example shows the markup for using a TransformGroup to fill the RenderTransform property.

XAML
<Canvas
  xmlns="https://schemas.microsoft.com/client/2007"
  xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
  Width="200" Height="200">
  <TextBlock FontSize="28" 
    Canvas.Left="100" Canvas.Top="100"
    Width="50" Height="50"
    Text="Hello">
    <TextBlock.RenderTransform>
      <TransformGroup>
        <RotateTransform Angle="45" />
        <SkewTransform CenterX="0" CenterY="0" AngleX="60"/>
      </TransformGroup>
    </TextBlock.RenderTransform>
  </TextBlock>
</Canvas>

See Also

Transform Overview
RotateTransform
ScaleTransform
SkewTransform
TranslateTransform
MatrixTransform
TransformCollection
Transform