You are on page 1of 14

Loading

Please wait...
Attention Necessary
 Alert body passed to window.alert
OK
  Google Search
Enter your search terms Submit search form
  Web Silverlight Tutorial

Silverlight Tutorial
Watch our 3-minute video to find out how you can learn
Silverlight with a live instructor.
Table of Contents
 What is Silverlight?
o An Overview of Silverlight
o The .NET Framework
o Introducing Silverlight
 What's New in the .NET Framework 3.5
o Overview
o Windows Presentation Foundation (WPF)
o Windows Communication Foundation (WCF)
o Windows Workflow Foundation (WF)
o Windows CardSpace
o Language Integrated Query (LINQ)
o LAB: Training Tool Using WPF and WCF
o Create a WCF Service
o Consume the WCF Service Using a WPF Application
 The Silverlight Framework
o Overview
o Installing Silverlight
o Silverlight Tools
o Silverlight Languages
o Windows Live Services
o Example Implementations
o Silverlight ASP.NET Controls
o Creating a Silverlight Application
o Walkthrough of Expression Blend
o Interacting with HTML Pages
o Silverlight Font Support
o Silverlight Full Screen Support
o Creating a Silverlight Animation
o LAB: Create a Simple Silverlight Application
o Experiment with a Silverlight Animation
o Create Sample Quote Application
 Silverlight Controls
o Overview
o Layout Controls
o User Interface Controls
o Designing User Interfaces
o User Controls and Custom Controls
o Create the Login Dialog
o Create a Login Status User Control
o Create a Blinking Custom Control
 Networking In Silverlight
o Overview
o Sockets Programming
o Service Oriented Architecture
o Other Networking Protocols
o Syndication Protocols
o Windows Azure
o Lab: Networking In Silverlight
o Create the Athlete Database
o Create the Athlete Class
o Create the Sport Class
o Create the Athlete Service
o Add a Service Reference
o Build an RSS reader
o Use an Azure Service
 Accessing Data Using Silverlight
o Storing Data in Code
o Working with XML
o Language Integrated Query (LINQ)
o Isolated Storage
o Data Binding
o Lab: Accessing Data In Silverlight
o Store User Credentials in Isolated Storage
o Add Controls to Display Athlete Information
 Animating Silverlight
o The Importance of an Impressive User Interface
o Drawing Graphics
o Animation
o Deep Zoom
o Lab: Animating Silverlight
o Painting with Video
o Animated Quotes
o Zoom In On Images
 Streaming Media Using Silverlight
o Integrating Multimedia
o Microsoft Expression Encoder
o Lab: Streaming Media Using Silverlight
o Stream Media Using Wet Floor Effect
o Stream and Encode Media
o Display Encoded Media
 Securing Silverlight Applications
o Software Security Basics
o Transporting Sensitive Data
o Cryptography
o Using the SQL Membership Provider for Authentication
 Debugging, Testing, and Deploying Silverlight Applications
o Error Handling Overview
o Debugging and Testing
o Deploying
o Lab: Deploying a Silverlight Application
o Deploy to the Silverlight Streaming Service
 Improving Silverlight Application Performance
o Synchronous vs. Asynchronous Processing
o The WebClient Class
o Lab: Improving Performance
o Download Images
 Team Development Using Silverlight
o Source Control Overview
o Microsoft Source Control Products
o Configuring Visual Studio 2008 For Source Control
o Configuring Expression Blend For Source Control
o Lab: Integrate Source Control
o Create a User Data Store and Validate User Credentials

Webucator Tutorials
 Ajax Tutorial
 ColdFusion Tutorial
 CSS Tutorial
 HTML Tutorial
 JavaScript Tutorial
 PHP Tutorial
 Schema Tutorial
 SQL Tutorial
 MySQL Tutorial
 XML Tutorial
 XSL-FO Tutorial
 XSLT Tutorial
 Web Accessibility Tutorial
 Silverlight Tutorial
 Java Tutorial

Webucator Resources
 Google Analytics Training
 Social Media Training
 SQL Training
 Windows Training
 HTML Training
 CSS Training
 JavaScript Training
 Ajax Training
 PHP Training
 XML Training
 Java Training
 Dreamweaver Training
 Flash Training
 Flex Training
 Photoshop Training
 Captivate Training
 SSRS Training
 SSAS Training
 SSIS Training
 Silverlight Training
 Project Management Training

Additional Resources
 Self-paced Training

 Bookmark this page:


 Add To Digg
 Add to reddit
 Add to Yahoo! My Web
 Add To Del.icio.us
 Add to Stumble Upon
 Add to Spurl
 Add to Furl
 Add to Ma.gnolia
 Add to Slashdot
 Add to Mister Wong
What is Silverlight?
In this lesson of the Silverlight tutorial, you will learn...
1. About the history of Silverlight.
2. About the Silverlight architecture.
3. Which environments support Silverlight.

This lesson will present you with a high-level overview of Microsoft


Silverlight.

An Overview of Silverlight
Silverlight enables development of the next generation of Microsoft .NET-based media
experiences and rich interactive applications (RIAs) for the Web. Silverlight is delivered
as a cross-platform and cross-browser plug-in that exposes a programming framework
and features that are a subset of the .NET Framework and Windows Presentation
Foundation (WPF).

Support

The industry has been abuzz about Silverlight since the beginning of 2007 when
Microsoft began demonstrating its power at developer conferences. In fact, no other
development technology has been so highly anticipated since the arrival of the .NET
Framework and Silverlight resources and examples abound on the Web. To spark
developer interest in Silverlight, Microsoft launched several community Web sites
dedicated to Silverlight development including the Silverlight home page
(http://www.microsoft.com/silverlight) and the Silverlight.net community Web site
(http://silverlight.net).

Early Adopters

In response to the overwhelming developer community anticipation for the arrival of


Silverlight, many developers and companies have become early adopters of the
technology.

Some example sites are listed below:

 World Series of Poker


 Discovery Channel
 The Emmys
 Home Shopping Network (HSN)
 World Wrestling Entertainment (WWE)
 Fox
 XBOX 360
 Netflix - uses Silverlight to allow subscribers to instantly watch movies on their
PCs or Intel-based Macs.

Many of the published early adopter applications are featured in the Silverlight.net
showcase.

The .NET Framework


Microsoft introduced the .NET Framework in 2000 as a new approach to software
development. The .NET Framework borrowed ideas from the best practices in the
software industry as well as brought new ideas to the table in an effort to meet developer
needs and requests.

Virtually all programming languages manage data at some point. The primary reason that
communication between applications created using C++, Visual Basic, Visual FoxPro,
and other languages was difficult was because each language stored data being managed
in a unique set of data types. For example, an integer in one language may not represent
an integer in another language. Data needed to be converted to common data types to
communicate between languages.

The .NET Framework introduced a common set of data types (the Common Type
System) that is used by all .NET-compliant languages (C++, Visual Basic, C#, etc). Thus
all languages can easily intercommunicate. Furthermore, all .NET-compliant languages
render a common result when compiling code, Microsoft Intermediate Language (MSIL).
(see footnote) MSIL can be deployed to any platform running the Common Language
Runtime (CLR). Currently, the CLR is only available for Microsoft Windows although an
open source version of the CLR was created for Linux (called the Mono Project). Code
written by using the .NET Framework is compiled instead of interpreted resulting in
much better performance than Java and competing technologies.

Microsoft took the Web development industry by storm with their .NET upgrade to ASP.
ASP.NET put a new face on Web development through a compiled code architecture and
improved state management and it provides access to the full functionality of the .NET
Framework. ASP.NET is built around XML, supports the latest Web development
standards, and allows for the creation of advanced Web Services.

The .NET Framework also provides improved data access and database integration
through ADO.NET. For more information, see MSDN.

There are many more features and benefits of the .NET Framework than those mentioned
here. The .NET Framework has become the leading software development environment
available.

Introducing Silverlight
What's New in the .NET Framework
As of the writing of this course, version 3.5 of the .NET Framework has been released.
Version 3.5 includes features that encompass all facets of Windows, Web, and network
development:

 Includes just under 10,000 classes, methods, and properties.


 Complies with the latest Web development standards.
 Introduces revolutionary technologies used in Windows Vista development, rich
media and user experiences, workflow management, security and authorization,
and complete distributed communication protocols.

The .NET Framework can also be fully extended by developers to create custom classes
and types. The functionality of the .NET Framework spans the server, the workstation,
and the Web. The four primary additions to the .NET Framework as of version 3.0 are:

1. Windows Presentation Foundation (WPF)


2. Windows Communication Foundation (WCF)
3. Windows Workflow Foundation (WF)
4. CardSpace

Windows Presentation Foundation (WPF)

WPF is used to develop elaborate user interfaces like those that adorn Windows Vista and
managed advanced media streaming and integration. WPF is the a complete revamp of
Windows Forms so that user interface, graphic, and media development is now designed
around the .NET Framework.

Windows Communication Foundation (WCF)

WCF encompasses the ASP.NET Web Services and .NET remoting functionality that
was contained in the .NET Framework 2.0 as well as new communication technologies.

Windows Workflow Foundation (WF)

WF is used to model complex workflow processes.

CardSpace

CardSpace is the embodiment of new security and user authorization functionality.

ASP.NET AJAX
ASP.NET AJAX was developed to improve performance in the browser by making post
backs and calls between the browser and server asynchronously. ASP.NET AJAX uses
new built-in types and controls and JavaScript.

Both ASP.NET and ASP.NET AJAX are heavily dependent upon the ASP.NET page
event life cycle, are tightly coupled to the server, and have a tough time competing with
advanced, media-rich plug-in solutions such as Adobe Flash. Additionally, it is difficult
to create Web applications that offer a consistent experience across all supported
browsers and platforms by using ASP.NET and AJAX. In 2006, Microsoft began
developing a solution to extend into the browser and offer media experiences more robust
than competing plug-in solutions.

In 2007, Microsoft introduced Silverlight. (see footnote) Silverlight is a free plug-in that
encompasses a subset of functionality from the .NET Framework and WPF. In a manner
similar to the JVM (see footnote), Silverlight runs in the browser as a "sandbox" - a
secure zone installed into the browser that accommodates Silverlight functionality while
completely protecting the host platform from any possibly adverse actions performed by
Silverlight.

Silverlight Architecture
Unlike ASP.NET, the bulk of Silverlight processing occurs on the client machine thus
decreasing server resource utilization and improving the Web experience on the client.
The figure below shows the difference between ASP.NET processing and Silverlight
processing:

When a client initially attempts to run a Silverlight application, if the Silverlight plug-in
has not been installed on the client machine, it will be downloaded and installed. Upon
subsequent requests to run the application, the application will instantiate on the client
machine and make requests for resources from the server only when necessary. The
Silverlight plug-in can be thought of as a scaled-down version of the full .NET
Framework. It only contains those classes and functionality that are applicable to a
Silverlight Web client and those were streamlined and optimized for use on the Web
client machine.

Silverlight was designed using the same design paradigm as ASP.NET. Each page of a
Silverlight application includes an associated code behind file that includes the code that
handles events fired by the page. Silverlight resembles WPF in that it uses Extensible
Application Markup Language (XAML) to construct the user interface (presentation
layer). As Silverlight applications are composed of text-based files that include markup
and code, they can be created using any text editor; however, more advanced tools and
development environments such as Visual Studio or Expression Blend simplify the task
significantly.

Silverlight Technologies
Version 1.0 of Silverlight used JavaScript and supported the industry-leading Windows
Media Services enabling delivery of audio and video that includes 2D and vector
graphics.

Version 2 includes all features of version 1.0 and:

 support for the .NET Framework.


 support for .NET-compliant programming languages such as C#, Visual Basic,
Python, and Ruby.
 support for database operations and language-integrated query (LINQ).

The figure below illustrates the major differences between version 1.0 and version 2:

The diagram located at


ClassFiles/WhatIsSilverlight/Demos/SilverlightTechnologyMap.gif gives a broad picture
of the technologies to be supported by Silverlight version 2.

Silverlight Hosting
Microsoft Silverlight functionality is completely encapsulated within the Silverlight plug-
in. Web applications typically require the server hosting the Web application to meet
minimum requirements. Silverlight applications simply require a Web server to be
equipped as they would be for hosting HTML documents. Silverlight applications can be
hosted on any Web server accessible to the target audience. The two most commonly
used Web servers are Microsoft Internet Information Server (IIS) and Apache.

Executing a Silverlight application on a Web client machine is a two step process. First,
the application will detect if the Silverlight plug-in is installed on the Web client
machine. If the plug-in is not installed, the user will be prompted with an option to
download the plug-in. If the user opts to do so, a request will be made of the Web server
to download and install the plug-in. The Silverlight plug-in is embodied in a .dll
executable file that is loaded into the Web client browser memory once installed. The
only interaction required by the Web client when installing the Silverlight plug-in is to
grant permission for the plug-in to be installed. Various Web servers, including Microsoft
Internet Information Server (IIS), may require slight configuration modifications so that
the Silverlight executable file will be downloaded to the Web client when requested.

Second, once the Silverlight plug-in is installed on the Web client machine, the
Silverlight application itself must be downloaded. A Silverlight application may consist
of many types of files. Slight configuration modifications may be necessary on the Web
server, such as MIME types, so that XAML and XAP files are associated with Silverlight
and downloaded correctly to the Web client machine when requested.

Once the Silverlight plug-in is installed on a Web client machine and a Silverlight
application is downloaded, the Silverlight application is then hosted on the Web client
machine. There are some requirements necessary for the Web client machine as discussed
in the sections below, however all media players, audio and video codecs, compilers and
the runtime are encapsulated in the Silverlight plug-in.

Supported Platforms
Silverlight can be installed on Windows and Macintosh machines. Silverlight
applications run within the confines of a plug-in. There are many benefits to using a plug-
in with the primary benefit being consistency across implementations. A plug-in
application can provide a consistent result in every instance where it is supported. Other
plug-in solutions, such as Adobe Flash, have become popular due to consistency across
implementations. For instance, a plug-in application should deliver a consistent result
regardless of whether it is displayed using Internet Explorer on Windows or Safari on a
Macintosh.

Silverlight 2 is currently supported on the platforms discussed below. (see footnote)

Platforms that Support Silverlight 2


Operating System Browser
 Windows Vista
 Internet Explorer 7+
 Windows XP SP2
 Firefox 1.5+
 Windows 2000
 Google Chrome
 Windows Server 2003
Platforms that Support Silverlight 2
Operating System Browser
 Safari
 Macintosh OS 10.4.8+ (Intel Based)
 Firefox 1.5+

Linux

Many developers are unaware that a version of the .NET Framework exists for the Linux
operating system. Linux is an open source operating system that is supported heavily in
the online community. The version of the .NET Framework that supports Linux is named
the Mono project and was also developed by the open source community. The developers
of the Mono project keep the project close to in sync with the .NET Framework when
updates are released by Microsoft and created an initial, limited version of Silverlight
(called "Moonlight") that supports Linux in approximately 21 days! (see footnote) You
can get up to date information on this project at http://www.mono-
project.com/Moonlight.

Future Platforms
The Silverlight plug-in renders graphics and multimedia using a vector-based graphics
engine. Vector graphics can easily be scaled from very small displays to very large
displays of varying resolutions with virtually no loss of image quality. Silverlight on a
Windows Mobile device will accommodate delivering live, streaming, high quality video
to smart phones and similar devices. The goal is to enable developers to deliver rich
interactive applications (RIA) to any type of device.

Microsoft has announced support for Silverlight on mobile devices with a limited initial
support for Windows Mobile and the Nokia S60 models. You can learn more about this
future support at http://www.microsoft.com/silverlight/overview/mobile.aspx.

What is Silverlight? Conclusion


In this lesson of the Silverlight tutorial, you

 Explored Microsoft Silverlight at a high level.


 Studied some of the history leading up to the release of Silverlight.
 Investigated the architecture of Silverlight.
 Learned which operating systems and browsers support Silverlight 2.

Footnotes
1. The Microsoft Silverlight deployment guide can be downloaded at
http://download.microsoft.com/download/7/8/d/78da8ec9-8801-42e5-89e5-
3809386f1316/Silverlight%20Deployment%20Guide.doc.
2. For a detailed list of the platforms supported by Silverlight, visit the Silverlight
system requirements page at http://www.microsoft.com/silverlight/system-
requirements.aspx#4_5.

3. The Linux version of Silverlight is called Moonlight. You can find out more about
Moonlight by visiting the Moonlight home page at http://www.mono-
project.com/Moonlight.

4. For a detailed list of the browsers supported by Silverlight, visit the Silverlight
system requirements page at http://www.microsoft.com/silverlight/system-
requirements.aspx#4_5.

5. The .NET Framework is similar to Java in this respect.

6. Silverlight was originally called Windows Presentation Foundation Everywhere


(WPF/E).

7. JVM = Java Virtual Machine

To continue to learn Silverlight go to the top of this page and click on the next lesson in
this Silverlight Tutorial's Table of Contents.
Last updated on 2009-05-11

All material in this Free is copyright 2010 Webucator. The purpose of this website is to
help you learn Silverlight on your own and use of the website implies your agreement to
our Silverlight Tutorial Terms of Service.

Use of http://www.learn-silverlight-
tutorial.com (Website) implies agreement
to the following:
Copyright Information
All pages and graphics on Website are the property of Webucator, Inc. unless otherwise
specified.

None of the content on Website may be redistributed or reproduced in any way, shape, or
form without written permission from Webucator, Inc.
No Printing or saving of pages or content on Website
This content may not be printed or saved. It is for online use only.

Linking to Website
You may link to any of the pages on Website; however, you may not include the content
in a frame or iframe without written permission from Webucator, Inc.

Warranties
Website is provided without warranty of any kind. There are no guarantees that use of the
site will not be subject to interruptions. All direct or indirect risk related to use of the site
is borne entirely by the user. All code and explanations provided on this site are provided
without warranties to correctness, performance, fitness, merchantability, and/or any other
warranty (whether expressed or implied).

For individual private use only


You agree not to use this online manual to deliver or receive training. If you are
delivering or attending a class that is making use of this online manual, you are in
violation of our terms of service. Please report any abuse to courseware@webucator.com.
If you would like to deliver or receive training using this manual, please fill out the form
at http://www.webucator.com/Contact.cfm

You might also like