LayoutTransform in Windows Phone 8

I wrote about LayoutTransform back when I needed it for Windows 8 XAML development. I modified the existing Silverlight Toolkit code to work with Windows 8 and it was great. Now a lot of people are asking the same question over and over again on StackOverflow - where's LayoutTransform in Windows Phone Toolkit?

Here's an example of that questions:

http://stackoverflow.com/questions/20663740/layouttransform-not-in-windows-phone-toolkit

And I've seen another 2-3 in the last 2-3 weeks.

Well, I don't know where it is, but I know what you can do to get it quickly. My initial idea was - just go to my blog and use the Windows 8 version with slight modifications. But people don't seem to be big fans of that, so I modified it (back) for Silverlight (Windows Phone) and here it is:

https://github.com/igrali/LayoutTransform-WP8

The original source code is here: http://bit.ly/Silverlight-LayoutTransform and is under MS-PL license.

Using it is really simple:

<StackPanel Grid.Row="1">  
    <Button Content="First" />
    <Button Content="Second" />
    <Button Content="Third" />
    <common:LayoutTransformer HorizontalAlignment="Left">
        <common:LayoutTransformer.LayoutTransform>
            <RotateTransform Angle="-75"/>
        </common:LayoutTransformer.LayoutTransform>
        <Button Content="Fourth" />
    </common:LayoutTransformer>
    <Button Content="Fifth" />
    <Button Content="Sixth" />
</StackPanel>  

Where "common:" simply references the Common folder in the project where LayoutTransformer project is.

The result?

layouttransform in windows phone example

Enjoy!

If you like this, share it with others. :)

Igor Ralic

igor ralic

View Comments
Microsoft Certified Solutions Developer: Windows Store Apps in C#