How can I map CLR Namespaces to XML Namespaces in an Assembly ?

Platform: WPF| Category: XML Namespaces

WPF defines a CLR attribute that is consumed by XAML processors in order to map multiple CLR namespaces to a single XML namespace. The ‘xlmns’ Definition Attribute is placed at the assembly level in the source code that produces the assembly. The WPF assembly source code uses this attribute to map the various common namespaces such as System.Windows and System.Windows.Controls to the http://schemas.microsoft.com/winfx/2006/xaml/presentation namespace.

The ’xmlns’ Definition Attribute takes two parameters: the XML namespace name and the CLR namespace name. More than one ’xmlns’ Definition Attribute can exist to map multiple CLR namespaces to the same XML namespace. Once mapped, members of those namespaces can also be referenced without full qualification if desired, by providing the appropriate using statement in the partial-class code-behind page. For more details, see ’xmlns Definition Attribute’.

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.