#85 – Two Main Namespaces Used in Every WPF XAML File

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)

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 131 other followers