Getting Started With Silverlight
Silverlight is a .NET Framework development platform for creating rich interactive applications (RIA) for web, desktop, and mobile platforms when online or offline. Silverlight also provides a free plug-in compatible with multiple browsers, devices and operating systems and supporting a new level of interactivity for applications.
For more information see:
- Getting Started with Silverlight. Tools and background information to start learning and building Silverlight applications.
- Silverlight. Conceptual and API documentation and many examples to help you understand and build your applications.
This topic describes Silverlight architecture and its components which create a powerful, lightweight platform for developing portable, cross-platform, networked applications that integrate data and services from many sources. Silverlight enables you to separate design and implementation concerns through a Model-View-ViewModel (MVVM) pattern. More specifically, you can separate your application view that is the User Interface (UI), from the business and data (back-end) logic. This model is supported by a set of tools specifically designed and integrated to support the life cycle of your application. For example:
- To build a compelling and highly interactive UI, a web designer can use Expression Studio which includes four design and development tools for building rich desktop and Silverlight applications for standards based web sites and streaming video.
- To build the business and data logic (back end), a developer can use Visual Studio 2010 or Visual Web Developer 2010 Express.
As we will describe later, the tools to build the UI and the tools to build the back-end logic work together in a seamless fashion.
While Silverlight offers a client-side runtime environment (browser plug-in) simple and compact in size, its development platform integrates a number of features and complex technologies. If you want to create effective Silverlight-based applications, you need a working knowledge of this platform architecture that is shown in the following illustration.
Fig.1 Silverlight Architecture
This layer contains the following core components to allow for the creation of powerful, interactive user interface:
- UI Core. It renders vector and bitmap graphics, animation and text.
- Inputs. It handles inputs form devices such as keyboard, mouse and so on.
- Media. It manages various audio and video files such as .WMP and .MP3 files.
- DRM. It enables the management of media asset digital rights.
- XAML. The eXtensible Application Markup Language is a language for declarative application programming. Silverlight uses a subset of the Windows Presentation Foundation (WPF) types that are implemented so that they can provide the required type backing for a XAML representation.
.NET Framework for Silverlight
This layer contains components that allow for the creation of the business and data elements or the back-end of your application.
- Data. It supports Language Integrated Query (LINQ) and LINQ to XML features which make easier to work with different data sources. It also supports the use of XML and class serialization for data handling.
- Windows Presentation Foundation (WPF). Silverlight WPF API extends the browser UI elements. This enables you to create graphics, animation, media and other rich client features. XAML is the declarative language to create these UI elements. WPF provides a parser implementation and language support for them. You can create the majority of your application UI in Extensible Application Markup Language (XAML) markup. That is why the previous illustration shows XAML extending over both presentation and .NET Framework layers.
- Windows Communication Foundation (WCF). It provides features to simplify access to remote services and data that include: browser object, HTTP request and response object, cross-domain HTTP requests, RSS/Atom syndication feeds, support for JSON, POX and SOAP services.
- Base Class Library (BCL) . This is a set of .NET Framework libraries which provide essential programming support such as string handling, regular expressions, I/O, reflection, collections and globalization.
The following technologies augment Silverlight application capabilities.
- o Silverlight applications run on the client machine and do not require support on the server. However, when you create your own application you may find it useful to integrate server capabilities such as:
- ASP.NET AJAX services. You can access most services that are used by AJAX from Silverlight applications. You do not have to change any code on the server, although you may have to change some configuration for the service on the server. These services are of two types:
- WCF AJAX services: These are services based on the WCF technology. They are usually identified by the presence of a characteristic ".svc" extension in their URL. These services are usually created using the AJAX-enabled WCF Service item template in Visual Studio 2010.
- ASP.NET AJAX services. These are services based on the ASP.NET Web Services technology. They are usually identified by the presence of a characteristic ".asmx" extension in their URL and by the use of the System.Web.Script.Services.ScriptServiceAttribute and System.Web.Script.Services.ScriptMethodAttribute attributes.
- WCF RIA services. WCF RIA services bring together the ASP.NET and Silverlight platforms. RIA services provide a pattern to write application logic that runs on the mid-tier to control access to data for queries, changes and custom operations. It also provides support for common tasks such as data validation, authentication and roles by integrating with Silverlight components on the client and ASP.NET on the mid-tier.
For more information about how Silverlight access ASP.NET AJAX services, see Accessing ASP.NET AJAX Services.