Adding an existing assembly to your Silverlight application
In response to a comment on my previous article, I have decided to post a little bit about adding an assembly to your Silverlight app. If you have used Visual Studio before with other assemblies, it is pretty much the same thing.
First, find where the assembly that you are trying to add is located. I usually copy it to a Lib somewhere above my project folder so that I can include it in source control when needed. The next thing you do is right click on the References folder in your Visual Studio Silverlight project (not the website project if you chose to include that in the Solution) and click Add Reference. Once the Add Reference dialog box shows up, click on the Browse tab and browse up to the folder that you put your assembly in, select it and click OK. Now that assembly will be included with your code.
Then to use this namespace in your Xaml code, you need to add the xml namespace directive to the top of your file along with the default Microsoft xml namespaces:
One of mine looks like this:
xmlns=”http://schemas.microsoft.com/client/2007″
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
xmlns:CraigN_Windows_Controls=”clr-namespace:CraigN.Windows.Controls;assembly=CraigN.Windows.Controls”
xmlns:Data=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data”
Both the xmlns:CraigN_Windows_Controls and xmlns:Data were added. As you can see, we direct the namespace to a CLR compiled library and a particular namespace inside that assembly. After this you should be able to reference any of the classes inside those namespaces by using the prefix that you chose next to the “xmlns: ” tag:
Data:DataGrid x:Name=”StoriesList” Grid.Row=”1″ Margin=”5″ AutoGenerateColumns=”True”
I will try to go through some of the rest of Scotts lessons here shortly, thanks!

Thanks Chris, this is exactly what I was looking for!
I get an error on using Craig’s WatermarkTextbox for Scott’s tutorials. It says Length cannot be less than zero. Parameter name:length. The source of the error is Page.xaml. I tried to add a property length to WatermarkTextbox control but that didn’t work. Any idea how to get around this?