Listing 1

<DockPanel
xmlns="http://schemas.microsoft.com/2003/xaml">
<Button DockPanel.Dock="Top" Background="Red">Button docked Top</Button>
<Button DockPanel.Dock="Bottom" Background="Yellow">Button docked
 Bottom</Button>
<Button DockPanel.Dock="Left" Background="Blue">Button docked Left</Button>
<Button DockPanel.Dock="Fill" Background="Green">Button docked to fill</Button>
</DockPanel>

Listing 2

<Window xmlns="http://schemas.microsoft.com/2003/xaml" >
  <FlowPanel>
      <Button Background="Red" Width="2in" Height="1in">Button1</Button>
      <Button Background="Green" Width="2in" Height="1in">Button2</Button>
      <Button Background="Blue" Width="2in" Height="1in">Button3</Button>
      <Button Background="Yellow" Width="2in" Height="1in">Button4</Button>
  </FlowPanel>
</Window>

Listing 3

<GridPanel Columns="3" Background="Black"
 xmlns="http://schemas.microsoft.com/2003/xaml">
  <Button Background="LightBlue" Width="1in" Height="1in">1</Button>
   <Button Background="LightBlue" Width="1in" Height="1in">2</Button>
<Button Background="LightBlue" Width="1in" Height="1in">3</Button>
 <Button Background="LightBlue" Width="1in" Height="1in">4</Button>
 <Button Background="LightBlue" Width="1in" Height="1in">5</Button>
<Button Background="LightBlue" Width="1in" Height="1in">6</Button>
<Button Background="LightBlue" Width="1in" Height="1in">7</Button>
<Button Background="LightBlue" Width="1in" Height="1in">8</Button>
<Button Background="LightBlue" Width="1in" Height="1in">9</Button>
<Button Background="LightBlue" Width="1in" Height="1in">0</Button>
</GridPanel>
<Window xmlns="http://schemas.microsoft.com/2003/xaml" >

Listing 4

<TextPanel Foreground="Blue">
<Inline FontFamily="Times New Roman" FontSize="16pt">This listing displays the
 <Italic>use of text </Italic>panels in XAML
<Bold>.Isn't XAML cool?</Bold> 
</Inline>
</TextPanel>
</Window>
Window xmlns="http://schemas.microsoft.com/2003/xaml" xmlns:def="Definition">

Listing 5

<FlowPanel>
    <FlowPanel.Resources>
      <SolidColorBrush def:Name="MyColor" Color="Red"/>
<SolidColorBrush def:Name="MyColor2" Color="Green"/>
    </FlowPanel.Resources>
<Button Background="{MyColor}" Foreground="Black">Background color is set using
  a resource</Button>
<Text Foreground="{MyColor2}">Text Color is set using a resource</Text>
 </FlowPanel>
</Window>

Listing 6

<Window xmlns=”http://schemas.microsoft.com/2003/xaml”
xmlns:def="Definition" >
<DockPanel>
<DockPanel.Resources>
<Style><Text Foreground="Red" FontSize="16pt"/></Style>
<Style def:Name="Mystyle"><Text Foreground="Blue"/></Style>
</DockPanel.Resources>
<Text>This text is Red.</Text>
<Text Style="{Mystyle}">Text with "BlueText" style.</Text>
</DockPanel></Window>

Listing 7

<Window xmlns="http://schemas.microsoft.com/2003/xaml"  xmlns:def="Definition" >
<DockPanel>
	<DockPanel.Resources>
		<Style >
		<Rectangle	Fill="Gold"
						Stroke="Red" StrokeThickness="3"
						Width="150" Height="100" Margin="10"
						RadiusX="10" RadiusY="10"
						/>
			<Style.VisualTriggers>
				<PropertyTrigger Property="IsMouseOver" Value="true">
					<Set PropertyPath="Fill" Value="limegreen"/>
				</PropertyTrigger>
			</Style.VisualTriggers>
		</Style>
	</DockPanel.Resources>
	<Rectangle />
</DockPanel>
</Window>

Listing 8

<Window xmlns="http://schemas.microsoft.com/2003/xaml" >
<Rectangle Fill="Pink" Width="1in"  Height="2in"  RectangleTop="25"
RectangleLeft="50" Stroke="Black" StrokeThickness="2" />
<Ellipse CenterX="70" CenterY="75" RadiusX="30" RadiusY="50" Fill="yellow"
 Stroke="Black" StrokeThickness="5"/>
</Window>

Listing 9

<Window xmlns="http://schemas.microsoft.com/2003/xaml" >
<Button Canvas.Top="20" Canvas.Left="20" Height="30" Width="20">
     <Button.Width>
      <LengthAnimationCollection>
        <LengthAnimation To="200" Duration="5" RepeatCount="500" 
          AutoReverse="True"/>
      </LengthAnimationCollection>
    </Button.Width>
    A Button
  </Button>  
</Window>

Listing 10

<Window xmlns="http://schemas.microsoft.com/2003/xaml" >
<TransformDecorator>
<TransformDecorator.Transform>
<SkewTransform AngleX="30"/>
</TransformDecorator.Transform>
<Rectangle 
        Fill="Pink"
        Width="1in"
        Height="2in"
        RectangleTop="25"
        RectangleLeft="50"
Stroke="Black" StrokeThickness="2"
        />
</TransformDecorator>
<TransformDecorator>
<TransformDecorator.Transform>
<RotateTransform Angle="90"/>
</TransformDecorator.Transform>
<Ellipse CenterX="70" CenterY="75" 
         RadiusX="30" RadiusY="50" 
         Fill="yellow" Stroke="Black" StrokeThickness="5"/>
</TransformDecorator>
<TransformDecorator>
<TransformDecorator.Transform>
<ScaleTransform ScaleX="2" ScaleY="5"/>
</TransformDecorator.Transform>
<Text>Hello</Text>
</TransformDecorator>
</Window>

Listing 11

<Window xmlns=http://schemas.microsoft.com/2003/xamlText="My First XAML
 Application" Visible="true" >
<GridPanel Columns="2" >
<TextBox ID="tbox1" Width="2in" Height=".5in" />
<Button  Background="Pink" Width="2in">Please click me</Button>
</GridPanel>
</Window>

Listing 12

<Window 
    xmlns="http://schemas.microsoft.com/2003/xaml"
    xmlns:def="Definition"   >
<GridPanel Columns="2" >
<TextBox ID="tbox1" Width="2in" Height=".5in" />
<Button  Background="Pink" Click="ButtonClick" Width="2in">Please click
 me</Button>
</GridPanel>
<def:Code><![CDATA[
void ButtonClick(object el, ClickEventArgs args)
   {
	  MessageBox.Show(tbox1.Text);
    }

]]>
</def:Code>
</Window>

Listing 13

<Window xmlns="http://schemas.microsoft.com/2003/xaml"
           xmlns:def="Definition"
           def:CodeBehind="Listing14.xaml.cs"
           def:Class="TestSpace.MyFirstApp"
	  Visible="true" Text="My First XAML application">
<GridPanel Columns="2">
<TextBox ID="tbox1" Width="2in" Height=".5in" />
<Button  Background="Pink" Click="ButtonClick" Width="2in">Please click
 me</Button>
</GridPanel>
</Window>

Listing 14

namespace TestSpace 
{
using System;
using MSAvalon.Windows;
    using MSAvalon.Windows.Controls;

    public partial class MyFirstApp:window
    {
        
void ButtonClick(object el, ClickEventArgs args)
  		 {
		
                MessageBox.Show(tbox1.Text);
     		}
	
}//End of class
}//End of namespace

Listing 15

<Window 
    xmlns="http://schemas.microsoft.com/2003/xaml"
    xmlns:def="Definition"
    def:Class="MyFirstApp"
    Text="My First XAML Application" Visible="true"
     >
<GridPanel Columns="2" >
<TextBox ID="tbox1" Width="2in" Height=".5in" />
<Button  Background="Pink" Click ="ButtonClick" Width="2in">Please click
 me</Button>
</GridPanel>
<def:Code><![CDATA[
 void ButtonClick(object el, ClickEventArgs args)
   {
		
                MessageBox.Show(tbox1.Text);
     }
[STAThread]
	static void Main()

{	Application app = new Application();
	MyFirstApp my = new MyFirstApp ();
        app.Run();

}


]]>
</def:Code>
</Window>

Listing 16

namespace TestSpace 
{
using System;
using MSAvalon.Windows;
    using MSAvalon.Windows.Controls;

    public partial class MyFirstApp:window
    {
        


void ButtonClick(object el, ClickEventArgs args)
  	 {
		
                MessageBox.Show(tbox1.Text);
    	 } 
	
	 [STAThread]
	static void Main()

{	
Application app = new Application();
		MyFirstApp my = new MyFirstApp();
        	app.Run();

} //End of main
}//End of class
}//end of namespace

Listing 17

<Project DefaultTargets="build">
<Import Project="$(LAPI)\WindowsApplication.target" />
<PropertyGroup>
<Property Language="C#" />
<Property TargetName="testapp" />
</PropertyGroup>
<ItemGroup>
<Item Type="compile" Include="*.cs" />
<Item Type="pages" Include="*.xaml" />
</ItemGroup>
</Project>