Home > Client Technologies > CompositeTransform simplifies transforms in Silverlight 4 Beta

CompositeTransform simplifies transforms in Silverlight 4 Beta

November 22, 2009

One of the features you may have missed that was added to the Silverlight 4 beta is the new CompositeTransform class. The new class provides a simpler way to transform an element, by simply offering a single object to instantiate rather than a group of transforms made for specific transforms. To animate properties, you will no longer need to name multiple Transforms or access them by index (hoping they were added in the expected order).

Not only is the code easier to write and less characters, but property access is clearer.  To rotate an object you change the Rotation property rather than the RotationTransform.Angle property. I think the simplicity of property access is demonstrated best by the C# example below.

XAML example

C# example

You will notice that the new Expression Blend for .NET 4 Preview still defaults to the verbose TransformGroup, but it will render the CompositeTransform without complaints.

For more information on the Silverlight 4 Beta, check out the Technical Feature Overview for Silverlight 4.

  1. December 4, 2009 at 3:40 pm

    Yeah this is great feature. Glad you pointed it out for every one. Definitely makes a lot of scenarios easier and less error prone.

  1. November 23, 2009 at 6:09 am
  2. November 23, 2009 at 6:12 am
  3. December 3, 2009 at 8:47 am
Comments are closed.
%d bloggers like this: