As PixelSense developer I love to have my own components declared in some assemblies that I reference in all projects I work.
I also love to have clean XAML file. It's true: for 90% of the time I edit XAML with Blend but there are cases when I use to edit it by typing my own XAML.
Now, if I, or Blend, have to reference my components in XAML, to declare and use my controls I would have a XAML reference like the following:
But.. I would like to have the same assembly declaration of the controls in the Surface SDK
I would love to have my own XAML namespace. Well this is possible, by adding some properties in the AssemblyInfo file of the project containing controls.
Just open the file mentioned above and add the proprerty(ies) needed for your scope:
[assembly: XmlnsPrefix("http://schemas.softwarelab.it/surface/2008", "sl")]
[assembly: XmlnsDefinition("http://schemas.softwarelab.it/surface/2008", "Softwarelab.Surface.Presentation.Controls")]
Now in your XAML you can declare you assembly in this way:
There is also another way to reference you controls embed it directly in the Surface SDK controls, if you wold like to see your controls mixed with the one of the SDK just add the following property to you AssemblyInfo:
[assembly: XmlnsDefinition("http://schemas.microsoft.com/surface/2008", "Softwarelab.Surface.Presentation.Controls")]
Now you will see your controls mixed with the controls of the SDK.
Pro of this approach is that once you referenced the Surface SDK controls you don't have to reference any more your controls.
Cons is that all controls are mixed up.
Personally I really like to have my own namespace!