WPF XML namespaces are those fancy little cryptic strings at the top of every WPF application that you use (generally prefixed with xmlns=”..”, meaning that they are the ‘default’ namespace [i.e. no prefix required]).
But what do they mean?
Simply put, they are ‘short cuts’ to import a whole plethora of .NET WPF assemblies and make their contents available for use in your XAML file.
The most commonly used namespace is http://schemas.microsoft.com/winfx/2006/xaml/presentation, and it imports the following .NET namespaces
As you might (or might not) know, there are other XML namespaces that you can use, each represents a particular version of WPF as follows (to date):
- WPF 3.0 -> http://schemas.microsoft.com/winfx/2006/xaml/presentation (also supported by Silverlight)
- WPF 3.5 -> http://schemas.microsoft.com/netfx/2007/xaml/presentation
- WPF 4.0 -> http://schemas.microsoft.com/netfx/2009/xaml/presentation
- Silverlight -> http://schemas.microsoft.com/client/2007 (not supported by WPF)
Note that these are all mapped to the same WPF assemblies, though they implicitly define which version of WPF you are targeting.
Also, a note about winfx vs netfx: winfx was the original name that was used to refer to the W*F technologies (WCF,WPF,WF)… this was later ditched by Microsoft.