Missing DockPanel? Add DockPanel for Silverlight 4 or Silverlight 5

When I first created a demo project for Silverlight 5, I opened the XAML code to start editing. I started typing "DockPanel" but then I noticed that intellisense didn't show anything. It turns out that DockPanel and some other controls aren't included in the default installation of Silverlight 4 or Silverlight 5 beta.

Here's what you need to do:

Download the Silverlight 4 Toolkit. Install it. (Yes, this will work with Silverlight 5 beta)

Add a reference to "System.Windows.Controls.Toolkit". In Silverlight 5, you will need to navigate to the file: %ProgramFiles%\Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\Bin\System.Windows.Controls.Toolkit.dll

Add the following attribute to your UserControl: xmlns:tk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"

So your code might look like:

<UserControl x:Class="Project1.MainPage"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">




If you made it this far, you should follow me on Twitter.


Want to test-drive Bitcoin without any risk? Check out my bitcoin wallet Coinbolt. It includes test coins for free.

comments powered by Disqus