XAML Namespaces

By Raj Kumar Beniwal Aug 13, 2008
The XML namespace declares sets three pieces if information.

<Canvas x:Name="canvas1" xmlns:w="clr-namespace:Widgets;assembly=ClientBin/Widgets.dll">

  • The XML namespace prefix - you will use the namespace prefix to refer to tha namespace in your XAML page.
  • The .NET namespace - In this case the classes are located in the widgets namespace. If you have classes that you want to use multiple namespace, you can map them to diffrent XML namespace or to the same XML namespace.
  • The assembly - In this case the classes are part of the widgets.dll assembly. You always precode this assembly with the folder name ClientBin. This is the subfolder of your website where visual studio places your compiled silverlight assembly and any class library assemblies that it uses. If you want to use a class that is defined in your silverlight project assembly. The assembly name is base on the name of your project as in SilverlightProject1.dll.
  • Raj Kumar Beniwal

    Raj Kumar Beniwal is two times Microsoft MVP(Client App Dev) and four times C# Corner MVP,  working as asst project manager with lots of hands on experience using ASP.NET 2.0/3.5, AJAX, MVC, C#, Visual Basic .NET, S... Read more

    COMMENT USING

    PREMIUM SPONSORS

    Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

    Latest Blogs