Skip to content
David Cumps
XAML: Irregular Controls

XAML: Irregular Controls

Originally published on my old blog at cumps.be on February 22, 2004.

The Longhorn SDK enables you to create XAML apps from VS.NET, so I did.

One of the things I’ll be looking for is an editor that generates XAML for me. Because, I find XAML “difficult” to write. Yes it’s powerful and “easy” to do, but if you have to do it all by hand, it takes time. So I’m hoping there will be an editor soon :)

I’ve seen the demo during the DevDays, where you had a different layout per user. And one of those was the kiddie layout, with the very cool button, which was shaped totally differently. So I set out to create a ‘NTFS Permissions For Dummies’.

Here’s what I created in Photoshop as a quick idea of what I wanted:

Photoshop mockup of the NTFS Permissions For Dummies window

Looks kiddie enough, doesn’t it?

Then I started my quest, it seems Longhorn doesn’t like it when I want to skew a ListBox with AngleX or AngleY. When I go over the items it renders strange lines everywhere in my app. Notice the blue lines:

Skewed ListBox with AngleX showing stray blue lines
AngleX
Skewed ListBox with AngleY showing stray blue lines
AngleY

This is the XAML I used (skewbug.txt); the second screenshot only changes AngleX to AngleY. It also happens with other values.

<TransformDecorator AffectsLayout="False">
  <TransformDecorator.Transform>
    <TransformCollection>
      <SkewTransform AngleX="30" />
    </TransformCollection>
  </TransformDecorator.Transform>
  <ListBox ID="ntfsUsers" Canvas.Top="27" Canvas.Left="10" Width="329" Height="128" Background="#18c335"
           BorderBrush="Black" BorderThickness="2" />
</TransformDecorator>

Gone was my idea to create these nice shaped controls.

But the gradient worked! And that’s actually very nice.

Here’s what I ended up with:

The XAML version with a gradient

It looks kinda nice, the colors still make it look kiddie-like.

Going to try writing the C# code-behind later this week if I find some time.

You May Also Like