4146. Silverlight 4 Using C#
Rev. 4.0
Microsoft’s Silverlight is a new client-side Web technology that
enables the implementation of visually stunning Web applications that depend
only on a small, easy-to-install plug-in that works in browsers for both Windows
and Macintosh. Silverlight provides a cross-platform and cross-browser
implementation of the .NET Framework. Out-of-browser support enables
Silverlight applications to run disconnected from the Internet. Silverlight
applications can be implemented in .NET languages such as C# and Visual Basic
as well as in JavaScript. This four-day course provides the C# programmer with
a thorough foundation in Silverlight 4.
After introducing the Silverlight plug-in and SDK and the
programming model for Silverlight, the course provides a thorough survey of
Extensible Application Markup Language (XAML), which is also the foundation of
Windows Presentation Framework (WPF). The course then shows how to use
Silverlight to draw shapes, lines, text and images. Layout is discussed in
detail, including sizing and positioning of controls and the use of panels.
Event handling is covered. There is an introduction to Silverlight animation
and the use of video and audio.
Networking issues are covered, including caching, asynchronous data
transfers, and downloading assemblies and resources on demand. The use of both
SOAP and REST based Web services is discussed. Two chapters cover data
controls, data binding and data access in detail, including the use of the
Entity Data Model and WCF Data Services. The last chapter covers additional
topics, such as the HTML
Bridge, out-of-browser
applications, the use of elevated trust, printing, and clipboard access. An
appendix covers transforms in Silverlight, which can be used to achieve various
special visual effects.
Numerous programming examples and exercises are provided. The
student will receive a complete set of notes and all the programming examples.
LEARNING OBJECTIVES
·
Gain a practical knowledge of using Silverlight
in Web applications
·
Understand the use of XAML with Silverlight,
including the creation of dynamic content
·
Use Silverlight to draw shapes, lines, text and
images
·
Implement input-driven Web applications using
Silverlight
·
Use advanced Silverlight features such as animation
and multimedia
·
Communicate over the network using HTTP and Web
services
·
Use data controls and data binding
·
Access data in Silverlight applications
·
Interoperate between JavaScript and managed code
·
Implement out-of-browser Silverlight
applications, including ones with elevated trust
·
Do printing and clipboard access from
Silverlight applications
Course Duration: 4
days
Prerequisites: A basic
understanding of Web application development using HTML and programming
experience in .NET using C#. Some exposure to JavaScript would be helpful but
is not essential. A basic knowledge of ADO.NET is also desirable for the data
access chapter.
1.
Introduction to Silverlight
Client-side Web Technologies
The Silverlight Plug-in
The Silverlight SDK
2.
Programming Silverlight
JavaScript API for Silverlight
Managed API for Silverlight
Visual Studio 2010 and Silverlight
Visual Studio 2010 Designer Support
Silverlight Controls
Layout Panels
Handling Events
Interactive Web Applications Using C#
Application Package (.xap)
3.
Using XAML
Windows Presentation Framework (WPF)
Extensible Application Markup Language (XAML)
Canvas
Elements and Attributes
Property Elements
Type Converters
Content Property
Collections
Attached Properties
XAML and C#
XamlReader
4.
Shapes and Lines
Rectangles
Ellipses
Polygons
Lines and Polylines
Curves
Paths
Geometries
Strokes
5.
Text and Fonts
TextBlock
Fonts
Run
LineBreak
6.
Brushes and Images
Color and Opacity
SolidColorBrush
LinearGradientBrush
RadialGradientBrush
Image
ImageBrush
7.
Layout
Sizing Elements
Margin and Padding
StackPanel
Grid
Positioning Elements
Z-Order
Clipping
8.
Handling Events
Event Handlers
Dynamic Event Handlers
Mouse Events
Rubber Band Drawing
Drag and Drop
Routed Events
9.
Animation and Media
Animation using Background Worker
Silverlight Animation
Video and Audio
Resources
10. Application
Structure and Networking
Silverlight Application Structure
Application Caching
WebClient
Loading Assemblies on Demand
Downloading Content on Demand
11. Web
Services
Implementing Web Services Using WCF
REST-based Web Services
SOAP-based Web Services
12. Data
Controls and Data Binding
ListBox
DataPager
DataGrid
Dependency Properties
Change Notification
Binding to a Collection
13. Data
Access
ADO.NET Entity Framework
Entity Data Model (EDM)
Language Integrated Query (LINQ)
Using Web Services
WCF Data Services
Open Data Protocol (OData)
LINQ to XML
Isolated Storage
14. Additional
Features
HTML Bridge
JavaScript to Managed Code
Managed Code to JavaScript
Out-of-Browser Support
Elevated Trust
Printing
Clipboard
Appendix A. Learning Resources
Appendix B. Transforms
Translate Transform
Rotate Transform
Scale Transform
Skew Transform
Combining Transforms
System Requirements
·
Microsoft Windows with Internet Explorer
·
Visual Studio 2010
·
Silverlight 4 Tools for Visual Studio 2010
·
SQL Server 2008 Express Edition, which comes
bundled with Visual Studio 2010
A good hardware profile for this course would have a 2-GHz or
equivalent CPU, 1 GB of RAM, and at least 4 GB of free disk. See the
appropriate course Setup Guide for details.