<UserControl x: Class="SilverlightApplication1.MainPage" xmlns:abc=" clr-namespace:ClassName; assembly=ClassLibraryName">
The XML namespace declaration sets three pieces of information:
â€¢ The XML namespace prefix: Youâ€™ll use the namespace prefix to refer to the namespace in your XAML page. In this example, thatâ€™s abc, although you can choose anything you want that doesnâ€™t conflict with another namespace prefix.
â€¢ The .NET namespace: In this case, the classes are located in the ClassName namespace. If you have classes that you want to use in multiple namespaces, you can map them to different XML namespaces or to the same XML namespace (as long as there arenâ€™t any conflicting class names).
â€¢ The assembly: In this case, the classes are part of the ClassLibraryName.dll assembly. (You donâ€™t include the .dll extension when naming the assembly.) Silverlight will look for that assembly in the same XAP package where your project assembly is placed.
Once youâ€™ve mapped your .NET namespace to an XML namespace, you can use it anywhere in your XAML document. For example, if the ClassName namespace contains a control named MyButton, you could create an instance like this:
<abc:MyButton Content="Click Me! " Click="DoSomething"></abc:MyButton>