Tutorial 0: the Road Map
The Road Map is a general introduction to the Silverlight 2 Tutorial series, and
provides a whirlwind example that utilizes skills and techniques that, while explained,
will be considered in much greater detail in the coming four tutorials. The goal
of this first Road Map is to provide an overview and a sense of what is to come.
Tutorial 1: Controls
Controls provides a tour of the Silverlight layout controls and how they are used
as well as a detailed explanation of events and event handlers and the use of Routed
Events and event bubbling in Silverlight. An example application is created in which
both an out of the box control and a composite control are dragged by responding
to various mouse events. Finally, the relationship between creating objects in XAML
and creating objects in managed code is shown along with an example of the dynamic
creation of new objects.
Tutorial 2: Data-binding
The roles of target and source and the modes of data binding
are introduced, and a business object that implements INotifyPropertyChanged is
created and bound to controls on a form. The purpose of the DataContext property
is explained and an example is created in which two instances of the business object
provide different Data Contexts for binding. Binding to various controls (check
box, text box text block) is shown as well as binding from a collection to a listbox,
along with one way and two way binding. In an afterword, the concept and advantages
of Dependency Properties are explained in some detail.
Tutorial 3: Styles and Templates
This tutorial builds on the form created in Tutorial
2, but adds style attributes to the various controls to enhance their appearance.
These style attributes are then factored out into Style objects in the Resources
section and applied back to the controls and ultimately overridden in part. Templates
are then shown for turning normal controls into lookless controls so that their
appearance can be totally redesigned without changing their behavior.
Tutorial 4: Accessing Data From a SQL Database
Many readers of the first three tutorials have written asking how they can use DataBinding to bind to data in their SQL database. This tutorial will walk through accessing SQL data by creating a Web Service and then using LINQ to create a data source you can bind to. The control we will bind to will be the DataGrid.
Tutorial 5: User Controls
NEW!
UserControls are extraordinarily useful. Variations of them have been around since the
days of #include files in classic ASP. A UserControl is basically a module of XAML and code
that you can easily re-use throughout your program. They are, in effect, a simple form of
custom control through aggregation of existing controls and code, much like User Controls
in ASP.NET