WPF code snipperts not working for you under Nov CTP of WinFX – then check out the changes!

I just got caught by this one. I had some rather simple looking samples I planned to demo tomorrow - except - they didn't work.

One such example would be:

<DockPanel  xmlns="http://schemas.microsoft.com/winfx/avalon/2005" LayoutTransform="scale 2">

        <Button Margin="10" Height="200" Width="100">

            <StackPanel >

                        <Image Source="c:\milkshake.jpg"/>

                        <TextBlock Margin = "10" TextAlignment="Center">Hi</TextBlock>




WPF just did not like the LayoutTransform property - despite the fact I could see many examples of its use on the web. The answer turned out to be the removal of mini language from the November CTP for transforms.

The above code now becomes:

<DockPanel xmlns="http://schemas.microsoft.com/winfx/avalon/2005">


        <ScaleTransform ScaleX="2" ScaleY="2" />


    <Button Margin="10" Height="100" Width="100" DockPanel.Dock="Top">


            <Image Source="c:\milkshake.jpg" />

            <TextBlock Margin="10" TextAlignment="Center">Hi</TextBlock>




The answer was easy enough once I found a draft article of what has changed and a rather nifty utility to fix up my code for me. Thanks to Karsten for his work on this.

Comments (0)

Skip to main content