I was wondering how the assemblies for third party projects are referenced in XAML.
Sometimes I see
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
and sometimes I see
xmlns:tn="clr-namespace:WPFTaskbarNotifier;assembly=WPFTaskbarNotifier"
What’s the difference between the URL style and clr-namespace style and when each one is used?
The XAML loader has to know what assemblies are referenced by elements within the XAML tree. It uses XML namespaces to find this value.
clr-namespacestyle namespaces are specially formatted in a manner that the XAML loader can locate the assembly and load the types defined within it. You can reference any assembly using this namespace format. When referencing types within the same assembly, you must use this format.the
URLstyle is a more conventional XML namespace style. The URL is supposed to point to a location where you can get information about the namespace, such as XSD schemas, etc. But more often than not they just are 404’d. You can allow callers who refer to types within your assemblies to use this style of namespace by defining it using the XmlnsDefinitionAttribute.Simply drop one per namespace segment within your AssemblyInfo.cs file: