What is the difference between schema namespace and assembly reference in WPF?

Why xaml has two types of links.

One is as follows:

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 

But mine look like this:

xmlns:WPFToolKit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"

Why can't I do this:

xmlns:local="http://myschema.mydomain.com/MyControlNamespace

Thanks to ixlettervariables for the answer. Here is a detailed explanation here

+5
source share
2 answers

The second instance is basically a non-displayable, but explicit reference to the namespace in the assembly. The first instance is a mapped namespace reference in some assembly referenced by your project. XAML namespaces and namespace mapping , in more detail on MSDN:

WPF CLR, XAML, CLR XML. XmlnsDefinitionAttribute , . WPF , System.Windows System.Windows.Controls, http://schemas.microsoft.com/winfx/2006/xaml/presentation namespace.

, , :

[assembly:XmlnsDefinition("http://myschema.mydomain.com/MyControlNamespace", "My.Control.Namespace")]
+7

XAML, , WPF.

CLR , assmebly namespace XML CLR/WPF.

0

All Articles