#85 – Two Main Namespaces Used in Every WPF XAML File
October 5, 2010 Leave a comment
You’ll find the same two namespaces listed at the top of every .xaml file in a WPF project:
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
These namespaces correspond to two XAML vocabularies that define elements allowed in a WPF-based XAML file.
Although a URI is used to specify each namespace, they do not correspond to an actual web site. The URI format is used to help ensure uniqueness across all organizations.
More information on these two namespaces :
- http://schemas.microsoft.com/winfx/2006/xaml/presentation
- Includes all WPF classes that you’ll use in your application, including all controls
- All XAML elements can be included in .xaml file without a prefix
- Vocabulary with full definition of allowed elements – WPF XAML Vocabulary Specification 2010
- http://schemas.microsoft.com/winfx/2006/xaml
- Includes XAML elements available to all XAML files and used to help in processing other XAML elements
- Elements from this namespace must be prefixed with “x:”
- Vocabulary available at – XAML Object Mapping Specification 2009 (see sec 5.2)