System.Windows.Media Namesp ...


.NET Framework Class Library for Silverlight
TransformGroup Class

Represents a composite Transform composed of other Transform objects.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)
Syntax

Visual Basic (Declaration)
<ContentPropertyAttribute("Children", True)> _
Public NotInheritable Class TransformGroup _
    Inherits Transform
Visual Basic (Usage)
Dim instance As TransformGroup
C#
[ContentPropertyAttribute("Children", true)]
public sealed class TransformGroup : Transform
XAML Object Element Usage
<TransformGroup>
  oneOrMoreTransforms
</TransformGroup>

XAML Values

oneOrMoreTransforms

One or more object elements for classes that derive from Transform. Typically these are the Silverlight defined classes RotateTransform, ScaleTransform, SkewTransform, TranslateTransform, MatrixTransform, or TransformGroup. Object elements defined here become members of the TransformCollection collection when code accesses the Children property at run time.

Remarks

Use a TransformGroup when you want to apply multiple Transform operations to a single object.

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 like 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 more than one TransformGroup is permitted.

Examples

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

Run this sample

XAML
<StackPanel>
  <TextBlock FontSize="28" Text="Hello">
    <TextBlock.RenderTransform>
      <TransformGroup>
        <RotateTransform Angle="45" />
        <SkewTransform CenterX="0" CenterY="0" AngleX="60"/>
      </TransformGroup>
    </TextBlock.RenderTransform>
  </TextBlock>
</StackPanel>
Inheritance Hierarchy

System..::.Object
  System.Windows..::.DependencyObject
    System.Windows.Media..::.GeneralTransform
      System.Windows.Media..::.Transform
        System.Windows.Media..::.TransformGroup
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

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

See Also

Reference

Other Resources

Tags :


Page view tracker