Beginning Silverlight – Walking through Scott Guthrie’s lessons
Scott Guthrie has posted some great introductory lessons for Silverlight on his blog. The only downside of it right now is they are a little outdated, they arewritten against the Silverlight 2 Beta 1 SDK, and there have been some significant updates in the new release of Silverlight 2 Beta 2. If you have not already, you can download Silverlight 2 Beta 2 here. This is an extension for VS 2008 including tools and the libraries needed. The beta 2 was released on June 6, 2008.
Microsoft has some MSDN Documentation on the Silverlight project which is extremely helpful, you can find that here. Especially the changes between Beta 1 and Beta 2 – here.
I found his blog postings very helpful, better than many of the tutorials I have found. I did run across one problem which Craig Nicholson came up with a workaround for. The WatermarkedTextBox control did not make it into the final evolution of Silverlight 2 beta 2. Scott’s blog post still calls for this control though, and I personally think its a very useful control. Craigs blog post is here, and you can download his project which still includes the WaterMarkedTextBox control here.
One thing I found about Craigs Tutorial, if your new to Silverlight and Xaml, the Xml Namespace declaration at the top needs to be prefixed with clr-namespace:, like so:
xmlns:CraigN_Windows_Controls=”clr-namespace:CraigN.Windows.Controls;assembly=CraigN.Windows.Controls”
Where Craig just had:
xmlns:CraigN_Windows_Controls=”CraigN.Windows.Controls;assembly=CraigN.Windows.Controls”
Note: Although this is a work around, for some reason when I used this control I was unable to type in the TextBox, I have not looked into this as of yet, will update when I take a look at the source. For now, I just removed it and used a standard TextBox control.
I noticed by default System.Net is not included as a library reference when you create a Silverlight project in VS 2008, but this is where the WebClient class lives, so you will need to add that reference to be able to use WebClient.
On a separate note, on thing I have gotten used to in Flex and AS3 development is not only tracing things, but using Alert boxes to show data when I want to know if something has returned the correct result. So, with this digg service request, I went to create a MessageBox (thinking its WPF!), well we actually don’t have a native MessageBox in Silverlight. There are integrations though into the page DOM which allows us to create JS popups though:
HtmlPage.Window.Alert(result);
Also, to use Linq to XML we need to reference the System.Xml.Linq assembly.
Data:
The Silverlight Data controls are in the System.Windows.Controls.Data assembly, in the System.Windows.Controls namespace. This also is not referenced by default, so it needs to be added to the project before adding the xmlns directive on the xaml page.
More to come…

Thanks for this info. I’m still having trouble connecting Craig’s assembly to my Digg project. Is there any good documentation on how to install an assembly? I have done what you said above, but I’m not sure where Craig’s files should be installed relative to the Digg sample. Also, what are the minimum set of file required to add Craig’s control to a project.
Thanks!
I have added a short walk through of adding the assembly to your project here : http://ninjadeveloper.wordpress.com/2008/06/16/adding-an-existing-assembly-to-your-silverlight-application/
If you downloaded Craigs source, you would have to compile his project then copy the assembly over. If you want, you can add his project to your own, and just choose the project instead of the assembly during the Add Reference phase.