
A Survey of Silverlight Controls
One of the major problems with Silverlight 1.0 was the lack of an integrated control library. Thankfully,
Silverlight 2.0 ships with a large number of controls which you can use to build the UI of your web plug-in.
These controls are similar in functionality to their Windows Forms, ASP.NET or WPF counterparts;
therefore you should already feel comfortable with the basic programming model.
A majority of Silverlight controls are defined within the System.Windows.Controls namespace. System.
Windows.dll is the assembly containing this namespace.
In addition, System.Windows.Controls.Data.dll can be referenced to gain access to the DataGrid control, and
related types. This assembly is not referenced by default for a Silverlight 2.0 project! If you wish to make use
of the Silverlight DataGrid, you must manually reference System.Windows.Controls.Data.dll. You will
examine the use of the DataGrid, as well as Silverlight data binding techniques during the lab time for this
chapter.
System.Windows.Controls.dll also provides access to some more ‘exotic’ Silverlight controls. Calendars, tab
controls, date time pickers, etc. System.Windows.Controls.dll is not referenced by default for a Silverlight
project! You must do so manually.
The reason the Silverlight controls have been broken into multiple libraries is to reduce the size of the XAP
file where possible. As soon as you reference and make use of these additional libraries, they are added to
your deployment manifest. This can increase the size of the XAP deployment file.
The assumption for this chapter is that you have referenced each of the control libraries. Your lab will point
out which libraries you need to reference when necessary.
In this chapter, you will focus on the overall programming model of Silverlight controls. However, do be
aware that the Silverlight documentation provides full details of each control. Simply look up the topic
"Control Gallery" and find the control you wish to examine. Here you will find details regarding the full set of
properties, methods and events a given control supports. Do yourself a favor. Be sure to consult the
Silverlight documentation to augment the materials presented in this class.
The following table documents the Silverlight controls from a high level, grouped by related functionality.
.
Silverlight 2.0 also makes it possible (and quite simple) to build custom controls. For example, you could
build a custom control based on existing controls. You could create a completely new control. You’ll learn
about building custom controls later in the class.
The Role of XAML Type Converters
Table of Contents
Copyright (c) 2008. Intertech, Inc. All Rights Reserved. This information is to be used exclusively as an
online learning aid. Any attempts to copy, reproduce, or use for training is strictly prohibited.
Courseware
Training Resources
Tutorials




Control Category
|
Example Members
|
Meaning in Life
|
Button Controls
|
Button, HyperlinkButton, RepeatButton
|
Basic button types / hyperlink support.
|
Selection Controls
|
CheckBox, ListBox, RadioButton, Slider, ScrollBar, ComboBox
|
Controls to allow the user to select from a range of options.
|
Date / Time Controls
|
Calendar, DatePicker
|
Controls to allow the user to select from a range of options.
|
Text Controls
|
TextBlock, TextBox
|
Allow for read-only and read-write text areas. Note that Silverlight does not have a Label control! Use TextBlock for Label-like functionality.
|
Data Display
|
DataGrid
|
Yes, Silverlight has a DataGrid!
|
Media Controls
|
Image, MultiScaleImage, InkPresenter, MediaElement
|
These provide support for audio and video playback, as well as support for the Ink API. The Ink API allows you to capture mouse / stylus movement using a pen-like metaphor.
|
Layout Controls
|
Border, Canvas, Grid, GroupBox, Panel, StackPanel, ScrollViewer, TabControl
|
Controls that allow you to group and organize other controls for the purpose of layout management.
|
User Help
|
Popup, TooltipService
|
Controls to help prompt user.
|
|
Services