S. Somasegar is the corporate vice president of the Developer Division at Microsoft. Learn more about Somasegar.
Last November we introduced the Silverlight Toolkit, an open source project designed to provide additional Silverlight controls and functionality between versions of Silverlight. Since then, we have received significant positive feedback and have already released a 2nd revision in December.
The December release contains even more themes, a new sample app, fine-tuned components, and a bunch of features and fixes requested from the development community. We’re also shipping designer DLLs to integrate the experience some, plus unit tests and the latest release of the unit test framework.
For those of you familiar with Windows Presentation Foundation, you’ll recognize the names of some of controls available in the toolkit. The controls in the "Stable" quality band are AutoCompleteBox, DockPanel, HeaderedContentControl, HeaderedItemsControl, Label, NumericUpDown, TreeView and WrapPanel. Controls in the "Preview" quality band include Charting, Expander, ImplicitStyleManager and Viewbox.
Using the controls is a matter of adding references to the assemblies in the toolkit and using them as regular controls in your Silverlight application. Below, you’ll find a few examples.
NumericUpDown is a TextBox that only allows numeric values while also providing the ability to nudge values up or down using either the mouse or keyboard. Setting various properties allow you to control Minimum, Maximum, Value and by how much to Increment. In the following Xaml, you can see how easy it is to use the NumericUpDown control.
And, the result would look as follows:
This is a great control to use when you want to constrain user input to numeric only while also providing a quick means to adjust the value.
Silverlight chart is a set of completely new classes that enable developers to easily create professional-looking column, bar, pie, line, scatter, and bubble charts. These different re‑stylable and re‑templatable charts are exposed as series controls that the chart control can host, allowing you to combine them.
Here's all it takes to create a simple column chart in XAML (note that there's no code required):
Let's take a look at a simple example:
The XAML above produces the following chart:
In addition to the controls listed in this post, you’ll also find ten themes available for your applications within the toolkit. Below, you can see a screenshot of what these themes look like.
You can learn even more about these controls and the Silverlight Toolkit on CodePlex here.