Tuesday, May 22, 2007

Accociate schema to custom namespaces

If we analyze a xaml file we could see 2 lines at the beggining.


These lines map the namespaces to xaml file.Whenever we need to refer our own custom dll we often use the following format .


We could also use the URL type mapping for our own controls.For this we need to include the following 3 lines in the Assemblyinfo.cs file of our custom dll.

  • Add a reference to using System.Windows.Markup;
  • Add 2 attributes

[assembly: XmlnsPrefix("http://schemas.joymon.com/mycontrols", "mycontrols")]
[assembly: XmlnsDefinition("http://schemas.joymon.com/mycontrols", "MyControls")]

Now you could use like the following in your xaml file to refer custom dll


A sample here

No comments:

Post a Comment