XAML
XAML is an acronym for extensible Application Markup Language. it is created by Microsoft. XAML is used to create the graphical user interface or UI for a .NET Framework application.
The root element of the XAML must have namespace defined as following:
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation
For example
The below code defines the root
<Window x:Class="WpfApplication54.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>
<TextBlock>Hello, Rohatash!</TextBlock>
</Grid>
</Window>
Now run it.

Figure1.gif
XAML Properties (attributes)
Using the following properties such as name, margin, VerticalAlignment and text property.
<Window x:Class="WpfApplication54.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>
<TextBlock Name="textBlock" Margin="5"
TextAlignment="Center" Text="Hello WPF!" />
</Grid>
</Window>
Now run the application and test it.

Figure2.gif
Implementation of button's Click event handler
<Window x:Class="WpfApplication56.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">
<Button Width="133" Height="24" Name="btnExitApp" Click ="btnExitApp_Clicked">
Exit Application
</Button>
<x:Code>
private void btnExitApp_Clicked(object sender, RoutedEventArgs e)
{
Application.Current.Shutdown();
}
</x:Code>
</Window>
Now run it and click on the Button application will shut down.

Figure3.gif