XamlTypeMapper.AddMappingProcessingInstruction Method

Defines a mapping between an XML namespace and CLR namespaces in assemblies, and adds these to the XamlTypeMapper information.

Namespace:  System.Windows.Markup
Assembly:  PresentationFramework (in PresentationFramework.dll)

public void AddMappingProcessingInstruction(
	string xmlNamespace,
	string clrNamespace,
	string assemblyName
)

Parameters

xmlNamespace
Type: System.String

The prefix for the XML namespace..

clrNamespace
Type: System.String

The CLR namespace that contains the types to map.

assemblyName
Type: System.String

The assembly that contains the CLR namespace.

ExceptionCondition
ArgumentNullException

xmlNamespace is null

-or-

clrNamespace is null

-or-

assemblyName is null.

AddMappingProcessingInstruction is a programmatic way to add a mapping. For example, the different parts of the following XAML mapping instruction correspond to the parameters of the AddMappingProcessingInstruction:

<Window xmlns:SDK="clr-namespace:Samples;assembly=SDKSamples">
...

The xmlNamespace is SDK, the clrNamespace is Samples, and the assemblyName is SDKSamples.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft