Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
  Tip: What is XAML?  
 
 

The .NET Framework 3.0 includes a language called XAML (Extensible Application Markup Language--pronounced zammel). It is a form of XML (Extensible Markup Language) that lets you define a user interface declaratively. You use XAML code to define grids, buttons, labels, and the other controls on a window. Visual Studio then reads the file and builds the appropriate controls. The XAML code can specify the controls' types (Grid, Button, Label), properties (Background, Content, Width, Height), and contents (text, other controls).

XAML is a complicated language and it will take a while to learn how to use it effectively. Search this site, Microsoft's Web sites, and other sites for XAML examples.

One of the more important ideas behind XAML is it separates the user interface more completely from the Visual Basic code behind it. In theory that means you can have a graphic designer build a form and then a Visual Basic (or C#) developer can add code to support the interface. Later, if you need change the interface, the graphic designer can move controls around, change their appearances, and even change they way they respond to events without requiring new Visual Basic code behind the scenes. (In practice, many companies may not be able or willing to hire separate graphic designers and programmers but that's Microsoft's theory.)

Microsoft claims that developers will jump on the .NET Framework/XAML bandwagon immediately if not sooner. I have my doubts about how quickly any transition will take place but it is pretty interesting stuff. See the picture on the XMAL calculator's Web page to see some of the interesting effects you can achieve with just a few lines of XAML code.

(I also think it's kind of funny that the X in XAML stands for Extensible since it's much less extensible that XML. You can define a few things such as resources and styles but the XAML language constrains you greatly. For example, you can only add rows and columns to a Grid, not a Label. That makes perfect sense but I wonder if XAML is really all that extensible. Perhaps they included the X just to look and sound cool ;-)

 

Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated