
410Microsoft Visual Studio 2010: A Beginner’s Guide
XML Application Markup Language (XAML), pronounced “Zamel,” is an XML- based language for building user interfaces. You’ll find XAML being used in both
Windows Presentation Foundation (WPF) and Silverlight applications. WPF is for desktop application development, and Silverlight is for
Starting a WPF Project
As you are reading a book about VS, it’s only natural that you would want to experience XAML from within the VS IDE. As stated earlier, we’ll use a WPF Application project for describing XAML because it has fewer files and is simpler than a Silverlight application. To create the WPF Application project, select File New Project and select WPF Application in the New Project window. Name the application anything you like and click OK. What you’ll see is a new project that has Window1.xaml file open in VS with contents similar to Listing
Listing B-1 A new XAML file
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525">
<Grid>
</Grid>
</Window>
In VS, the default layout for Window1.xaml is to have a visual designer on the top half of the work window and XAML in the lower half. You can view the full XAML document by grabbing the top edge of the XAML half and dragging it to the top of the screen so that you are only looking at the XAML editor. The first thing you should notice about Listing