As the builder of the Windows SDK, I have a vested interest in what is delivered with the SDK.  I’m sharing some of the interesting jewels I've found in my series “Windows SDK Hidden Gems.”  In my last post I talked about the Windows Installer Verbose Log Analyzer (WiLogUtl.exe).

Technologies come and go.  Some show real promise, and others take the computing world by storm. XAML is one of the latter.  Working in concert with WPF (Windows Presentation Foundation is part of the .NET Framework), XAML greatly increases the options for designing interfaces used in the next generation of programs. One of the many programs that takes advantage of XAML is Silverlight. When used by Silverlight as a graphics description language, XAML opens the door to animation and rescaleable graphics and typefaces for interactive web sites.

This month’s hidden gem, XAMLPad.exe, encourages the user to play and experiment with XAML.  It’s great for testing out the many XAML samples available on the net and in the Windows SDK.  XAMLPad is installed with the Windows SDK .NET Framework Tools component and can be found from the Start menu at All Programs/Microsoft Windows SDK/Tools/XAMLPad.

As with any new acronym there’s the question, “How do you pronounce that one?”  In this case, XAML rhymes with camel.

clip_image001

Here’s a screenshot of a quick sample done after about an hour poking around with the WPF documentation and the XAML overview. The sample code is available below.

A few quick notes about XAMLPad

  • In order to run XAMLPad you will need the .NET Framework 3.0 or later installed on your computer. This is included in the Vista operating system.
  • XAMLPad allows viewing the XAML code several different ways, such as a visual tree hierarchy.
  • Right clicking in the edit pane brings up a snippets menu for commonly used code.
  • To open a specific file, it must be specified on a command line.
  • There is no file menu. When the code entered passes validation, it is saved to a XAMLPad_Saved.XAML file.

Here is the sample code for the image above. It can be copy/pasted in its entirety.

  <Page xmlns="http://schemas.microsoft.com/winfx/2006/XAML/presentation"
      xmlns:sys="clr-namespace:System;assembly=mscorlib"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/XAML" >
  <Grid>
    <Canvas Height="200" Width="200">
      <Ellipse Width="200" Height="200"
        Fill="Yellow"
        Stroke="Black" StrokeThickness="4"
        Canvas.Left="10" Canvas.Top="10"/>
      <Ellipse Width="10" Height="10"
        Fill="Black"
        Canvas.Left="60" Canvas.Top="75" />
      <Ellipse Width="10" Height="10"
        Fill="Black"
        Canvas.Left="150" Canvas.Top="75" />
      <Path Stroke="Black" StrokeThickness="4"
        Data="M 60,130 C 60,190 160,190 160,130" />
    </Canvas>
  </Grid>
</Page>

hopefully, this will get you started in the world of XAML. I’m off to find more gems to present.

Cheers,
Curtis

Windows SDK Builder

The MSDN Windows SDK Developer Center is the place to find resources and links to Windows SDK products, release notes, technical articles, and more.