Namespaces

The most mysterious part about comparing the previous XAML examples with the equivalent C# examples is how the XML namespace http://schemas.microsoft.com/winfx/2006/xaml/presentation maps to the Windows Runtime namespace Windows.UI.Xaml.Controls. It turns out that the mapping to this and other namespaces is hard-coded. (In case you’re wondering, no web page exists at the schemas.microsoft.com URL—it’s just an arbitrary string like any namespace.) Because many Windows Runtime namespaces are mapped to the same XML namespace, the framework designers took care not to introduce two classes with the same name, despite the fact that the classes are in separate Windows Runtime namespaces.

The root object element in a XAML file must specify ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.