« Reflections in Adobe Illustrator and XAML | Main | Moon Mosaic »

What the heck is XAML?

One of my friends asked me what XAML was. I replied to  the best of my ability:

At some point, I'll glassify my blog logo.

XAML is the XML markup which is one way to get visual stuff done in WPF, the Windows Presentation Foundation. The other way is  through code. Vista and soon extensions to XP will let you write applications with a declarative interface. Typically, in Java or C#, you might write a UI by doing something like this:

Button btn = new Button();
btn.Foreground = Brushes.LightSeaGreen();
btn.FontSize = 32
btn.Content = "Hello, XAML!"

In WPF, you can do that but you can also declare the UI like you would HTML... which has some nice succinctness and layout power:

<Button Foreground="LightSeaGreen" FontSize="32pt">
    Hello, XAML!
</Button>

This example was taken from Charles Petzold's new book: Applications = Code + Markup: A Guide to the Windows Presentation Foundation sure to be the next classic just like his original Programming Windows.

Next up is a bouncing ball demo done in WPF, and not Microsoft XNA. The ball will bounce on a glass surface and the reflection will show in real-time. This is the power of the visual brush which is used to paint the reflected surface. It dynamically changes as the source image used to create the visual brush changes.

I think amazing games can be written in WPF, which has support for 3D. You can, for example, create a nice visual and then stick it on a cube and rotate it in 3D. The visual can even animate as the cube rotates.

It’s also kind of a flash-killer. Eventually, Microsoft plans on writing a scaled-down engine to run on other platforms such as Linux and the Mac. This scaled down platform is called WPF/E (E for Everywhere, I think).

Cool stuff.

TrackBack

TrackBack URL for this entry:
http://www.primordia.com/blog/mt-tb.cgi/623