In our earlier posts, in the MainWindow.xaml file, we see that there are 2 lines related to xmlns. xmlns means xml namespace.
In this post, we look at the presence and purpose of the two XAML namespace mappings as they are commonly found in the root tag of a WPF XAML file.
<Window x:Class="SayHello.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="500"> <Grid> </Grid> </Window>
The first declaration maps the overall WPF namespace as the default:
It is the default XML namespace and it is mapped to the normal WPF namespaces such as System.Windows, System.Windows.Controls and so on.
The second declaration maps a separate XAML namespace, mapping it to the x: prefix.
An example XAML namespace that it maps to is System.Windows.Markup.