Now that title is a mouth-full. I’ve seen a few questions in the Silverlight.net forums asking how to get the Silverlight Toolkit controls into the toolbox/asset library of Visual Studio 2008 and/or Expression Blend 2. There are a bunch of great posts scattered among the tubes on how to do this but I wanted to explain both Visual Studio 2008 and Blend 2 in one post. Plus it’ll segue nicely into an upcoming post :)
Download the Silverlight Toolkit
- Download the latest release of the Silverlight Toolkit (December 2008 as of this post).
- Unzip to a folder of your liking (I use the highly imaginative
C:\Source\Silverlight Toolkit December 2008
).
Adding to the Visual Studio 2008 Toolbox
You can add the controls to any tab in the Toolbox you like, for this example I’m going to create a new tab, Silverlight Toolkit.
- Right-click anywhere in the Toolbox and select Add Tab, name it Silverlight Toolkit.
- Right-click in the empty space of the Silverlight Toolkit group and select Choose Items.
- Select the Silverlight Components tab.
- Click Browse and browse to Binaries folder, adding
Microsoft.Windows.Controls
,Microsoft.Windows.Controls.Input
andMicrosoft.Windows.Controls.DataVisualization
. - The controls will now appear in your Toolbox.
Adding to Expression Blend 2 Asset Library
Adding controls to Blend is even easier, though you do have to repeat this process for each new project. Also because making controls available in Blend requires you to add references to your project, thus increasing your download size, you should only add references to the assemblies you need. Bit of a chicken and egg issue. To help you decide which assemblies to add I included a breakdown of which controls are in what assembly after these instructions.
-
In your Project pane right-click on References, select Add Reference….
-
Add references to Microsoft.Windows.Controls, Microsoft.Windows.Controls.DataVisualization, Microsoft.Windows.Controls.Input.
-
The controls will now appear in the Custom Controls section of the Asset Library.
What’s In Each Assembly?
Microsoft.Windows.Controls
- AutoCompleteBox
- DockPanel
- Expander
- HeaderedContentControl
- HeaderedItemsControls
- Label
- TreeView
- TreeViewItem
- Viewbox
- WrapPanel
Microsoft.Windows.Controls.Input
- ButtonSpinner
- NumericUpDown
Microsoft.Windows.Controls.DataVisualization
- Charting (with associated Axis, DataPoint and Series).
Getting Support, Offering Feedback
As always the best place to get support for the Silverlight Toolkit is to post in our forum on Silverlight.net. If you have a feature request or bug please file it in our Issue Tracker and get some votes behind it. We look carefully at those numbers when we decide how to prioritize the bug fixes.
(Updated to include warning about adding assemblies you don’t need in Blend and what controls are in each assembly, plus fixed the title tag on a few images)