Intersoft ClientUI Documentation
ContentTransformer
ContentTransfomer is a lightweight content control that apply transform effects to its content without affecting the dimension and boundary of the main container.

Content Control

ContentTransfomer is inherited from ISContentControl, which means it can contain a single object of any type (such as a string, an image, or a panel). For more information about this content model, see Content Model Overview.

Understanding ContentTransformer

At the core of ContentTransfomer control is the Transform property which applies transformation effects such as ScaleTransform and RotateTransform to its content. The transformation of ContentTransfomer works differently compared to the standard RenderTransform provided in built-in Silverlight elements.

The ContentTransfomer transforms its content with respect to the dimension and boundary of the main container, while Silverlight's RenderTransform applies the transformation using relative points. The following illustration compares the transformation results of ContentTransfomer and RenderTransform.

 

As shown in the above illustration, the ContentTransfomer applies the RotationTransform to the menu bar while properly aligning the menu bar to the boundary of the main container. This behavior is useful in a number of scenarios where you want to apply the transformation effects on a content that can be easily arranged and layouted.

Using ContentTransformer

One of the most common scenarios in which the ContentTransfomer can be particularly useful is when you want to apply rotation effect to fit into a container, similar to the orientation feature in tool bar. Since the ContentTransfomer respects the alignment, margins, and other layout properties while applying the transformation, you can use ContentTransfomer to get consistent transformation results that arranged in the way you desire.

The following example shows how to use ContentTransfomer to apply RotationTransform to its content.

XAML
Copy Code
<Intersoft:ContentTransformer VerticalAlignment="Top">
    <Intersoft:ContentTransformer.Transform>
        <CompositeTransform Rotation="-90"/>
    </Intersoft:ContentTransformer.Transform>

    <Intersoft:UXMenuBar VerticalAlignment="Top">
        <Intersoft:UXMenuItem Header="File">
            <Intersoft:UXMenuItem Header="New"/>
        </Intersoft:UXMenuItem>
        <Intersoft:UXMenuItem Header="Edit"/>
            <Intersoft:UXMenuItem Header="Cut"/>
        </Intersoft:UXMenuItem>
    </Intersoft:UXMenuBar>

</Intersoft:ContentTransformer>
See Also