From the course: Microsoft XAML: 1 Core Concepts

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Ad hoc namespaces

Ad hoc namespaces

From the course: Microsoft XAML: 1 Core Concepts

Start my 1-month free trial

Ad hoc namespaces

- [Walt] Predefined XAML namespaces are convenient, but they're not available for all class libraries. Remember that someone has to take the time to setup the mapping to the URI and the .NET namespace. Also, custom predefined namespaces are not supported in Universal Windows applications. So that makes it harder to do the mapping in those libraries. There is an alternate syntax that lets you work with .NET or WinRT classes in any namespace even when there's no predefined mapping. To demonstrate that, I'll use this solution, AdHocNamespaces, which has two projects. I have my WpfApp and I have a reference in here to this CoursewareControls library. Inside the CoursewareControls, I have two of my controls, the Gauge and the IpAddress. In my AssemblyInfo, you'll see that I commented out the XmlnsDefinition, so I don't have the predifined mapping anymore. I have a Reference over here, we saw that. And then what I did is I moved two of the controls from the separate assembly and put them in…

Contents