CompositeTransform simplifies transforms in Silverlight 4 Beta

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.

This entry was posted in Client Technologies and tagged . Bookmark the permalink.

4 Responses to CompositeTransform simplifies transforms in Silverlight 4 Beta

  1. Pingback: Dew Drop – November 23, 2009 | Alvin Ashcraft's Morning Dew

  2. Pingback: uberVU - social comments

  3. Pingback: Блог Сергея Пугачёва » Использование CompositeTransform в Silverlight 4

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

Leave a Reply