Silverlight Fits by gabyion


									Silverlight An overview.
         Microsoft Silverlight is a cross-browser, cross-platform implementation of the .NET Framework for
         building and delivering the next generation of media experiences and rich interactive applications
         (RIA) for the Web.

    1. It is a cross-browser, cross-platform technology. It runs in all popular modern web browsers.
    2. It provides a consistent experience no matter where it runs.
    3. It is supported by a very small download that installs in seconds.
    4. It includes compelling graphics that users can manipulate drag, turn, and zoom—directly in the
    5. It reads data and updates the display, but it doesn't interrupt the user by refreshing the whole page.

Silverlight Fits
    Silverlight executes in the client browser:
    1. Silverlight applications need to be hosted on a web server
    2. Silverlight does NOT need to be hosted in IIS, any web server will do
    3. Silverlight does NOT need ASP.NET on the server
    4. Silverlight applications cannot access databases without an intermediary (like a web service)
    5. Silverlight applications cannot access server-side classes or variables without an intermediary (like a
         web service)

Silverlight Versions
    1.   Silverlight 1 is very good at displaying Media (audio and video) but it's lack of controls and reliance
         on JavaScript as the only programming language, introduce numerous limitations.
    2.   Silverlight 2 introduces the .NET framework to Silverlight along with the DLR and a rich control set.
         The majority of applications being built today are using Silverlight 2.

Main features of Silverlight 1.0:

    1. Built-in codec support for playing WMV video, and MP3 and WMA audio within a browser.
    2. Silverlight supports the ability to progressively download and play media content from any web-
    3. Silverlight also optionally supports built-in media streaming.

   4. Silverlight enables you to create rich UI and animations, and blend vector graphics with HTML to
        create compelling content experiences.

Main features of Silverlight 2.0:

   1.   Includes a version of the .NET Framework, with the full Common Language Runtime as .NET
        Framework 3.0;
   2.   A built in CLR engine which delivers a super high performance execution environment for the
   3.   Silverlight 2 includes Deep Zoom, a technology derived from Microsoft Live Labs Seadragon. It
        allows users to zoom into, or out of, an image (or a collage of images), with smooth transitions, using
        the mouse wheel. The images can scale from 2 or 3 megapixels in resolution into the gigapixel range,
        but the user need not wait for it to be downloaded entirely; rather, Silverlight downloads only the
        parts in view, optimized for the zoom level being viewed.
   4.   Silverlight 2 also allows limited file system access to Silverlight applications. It can use the operating
        system's native file dialog box to browse to any file to which the user has access.
   5.   The XAML layout markup file (.xaml file) can be augmented by code-behind code, written in any
        .NET language, which contains the programming logic.
   6.   This version ships with more than 30 UI controls (including TextBox, CheckBox, Slider,
        ScrollViewer, and Calendar controls), for two-way databinding support, automated layout
        management as well as data-manipulation controls, such as DataGrid and ListBox.

How Silverlight would change the Web:

   1.   Highest Quality Video Experience.
   2.   Cross-Platform, Cross-Browser.
   3.   Developers and Graphic Designers work together: Developers familiar with Visual Studio, will be able to develop amazing Silverlight applications very quickly. So developer can
        strictly focus on the back end of the application core, while leaving the visuals to the Graphic Design
        team using the power of XAML.
   4.   Cheaper: Silverlight is now the most inexpensive way to stream video files over the internet at the
        best quality possible. All we need IIS in Windows Server.
   5.   Support for 3rd Party Languages:
   6.   Speed: There is a very good improvement in speed for AJAX-enabled websites that begin to use
        Silverlight, leveraging the Microsoft .net framework

Running Silverlight-Based Applications (Is this Section needed? really)

       Silverlight-based applications run in all modern browsers, without having to create browser-specific
       To run a Silverlight-based application, users require a small plug-in in their browser. The plug-in is

       If users do not already have the plug-in, they are automatically prompted to install it. The download
       and installation take seconds and require no interaction from the user except permission to install.

Silverlight Architecture

       Silverlight is not only an appealing canvas for displaying rich and interactive Web and media content
       to end users. It is also a powerful yet lightweight platform for developing portable, cross-platform,
       networked applications that integrate data and services from many sources. Silverlight enables you to
       build user interfaces that will significantly enhance the typical end user experience compared with
       traditional Web applications.

       Silverlight as a client-side runtime environment seems simple and compact in size, the Silverlight
       development platform integrates a number of features and complex technologies, making them
       accessible for developers.

        Silverlight-based applications are executed in a run-time environment on the client machine. No
       particular application is required to be installed on the server. However, we can create rich
       applications that integrate services and data from multiple sources on the server is enhanced by
       integrating the different types of services and server-side applications into their Silverlight-based

   1.   ASP.NET AJAX. This includes a set of controls, services, and libraries for creating rich and
        interactive Web-based applications.
   2.   Microsoft Windows Communication Foundation (WCF) services.
   3.   Internet-based applications and services, including Microsoft ASP.NET, PHP, Windows Streaming
        Media services.

A Silverlight application will be comprised of three things:
   1.   The application classes or services which are implemented within the application assembly,
   2.   The in-package library assemblies as well as resource files which can encapsulate
   3.   The UI and functionality.

        The third element which comprises the Silverlight application structure is the On-demand library
        assemblies or resource files which must be responsible for dealing with UI functionality.

        Every Silverlight application will need to implement the functionality in order to begin running once
        the Silverlight plug-in has downloaded it. The Silverlight plug-in requires all the Silverlight
        applications to implement their startup functionality within a well known as specific manner, which is
        referred to as being the entry point.
        Within the Silverlight application, entry points will be comprised of a number of three things, and
        these are a class, assembly, and metadata. The class will be derived from the actual Application,
        which may also be called the application class. The assembly will comprise the application class, and
        will be known as the application assembly.

        The metadata will be responsible for specifying the application assembly and class which in turn
        comprise the entry point. Another important factor which is connected to the development of
        applications within Silverlight is Application Services.

        The Application class offers numerous application services which are typically need via applications.
        The more critical service is the capability of notifying the UI to show whenever the application is
        activated. Other important services are lifetime management, initialization parameters, and the
        detection of unhandled exceptions.

The Library Assembly and Resource Files (Is this Section needed? really)

        The library assembly within Silverlight is used for the purpose of encapsulating important UI
        functionality. The library assemblies may be used for a number of different purposes, and this can
        include the organization of the application into smaller portions and sharing both UI and functionality
        via numerous applications.

        While it is important for both the library as well as the application assemblies to encapsulate the
        various functions of the Silverlight app, this application may also be comprised of data which is non-
        executable, and good examples of this include video, images, audio, XAML, and XML.

        The application package may come in the form of a Zip file archive which is complete with the .xap
        file name. The application package will need to be as small as necessary in order to offer the quickest
        download speed possible.

Silverlight and WPF
        Silverlight is a limited subset of WPF, both of which use XAML as their markup language. This
        allows for several things, such as the shortening of the learning curve when moving from one to the
        other. If we develop an application using Silverlight, it can normally be ported to run as a WPF
        desktop application with minimal effort. But moving from WPF to Silverlight can be more
        troublesome due to the greatly increased .NET framework and control set in WPF.

Silverlight and ASP.NET
        ASP.NET and Silverlight overlap in some of their capabilities, but Silverlight is not a straight
        replacement for ASP.NET. Since code written for ASP.NET executes on the server it has access to
        the entire .NET framework, can use connection strings to access databases and can use any number of
        third-party or internally generated class libraries.
        Even on the client, If our application are nothing more than data-entry forms, the standard ASP.NET
        controls are very well suited to that kind of work.

Silverlight and AJAX
        Built into the Silverlight plug-in and SDK are numerous features that perform the same functionality
        that provided by AJAX. Silverlight has very rich support for reading data of numerous types from
        web services to RSS feeds to static XML files.

Silverlight Application Project

        A Silverlight application project is created by using the Silverlight Application project template. We
        use the following steps to create a new Silverlight application project.

To create a new Silverlight application project (Is this Section needed? really)

    1. On the File menu Visual Studio 2008, click New and then Project.

        The New Project dialog box appears.

    2. In the Project types pane, expand the Visual C# or the Visual Basic node and select Silverlight.
    3. In the Templates pane select Silverlight Application.
    4. Specify a name and a location for the application and then click OK.

        The Add Silverlight Application dialog box opens.

    5. Select a method for hosting your Silverlight application

          i.    Select the Add a new ASP.NET Web project to the solution to host Silverlight option if you
                want to add a separate ASP.NET-based Web site to your solution to host the Silverlight
                application. If you select this option, you must also specify the Project Type and Name in the
                Options pane.

             ii.    Select the automatically generate a test page to host Silverlight at build time option if you do
                    not want to use a Web site to host your Silverlight application. Instead, an HTML test page
                    will be generated to host your application.

       6. Click the OK button.
       7. To build the Silverlight application project, in the Build menu, click Build Solution.
       8. To debug the Silverlight application project, in the Debug menu, click Start Debugging.
       9. To run the Silverlight application project, in the Debug menu, click Start without Debugging.

Silverlight Application Project Files

A Silverlight application project contains the following configuration, assembly references, and code files:

   i.      AppManifest.xml
           This is the application manifest file that is required to generate the application package. We should
           not edit this file.
  ii.      AssemblyInfo.cs or AssemblyInfo.vb
           This file contains the name and version metadata that is embedded into the generated assembly.

 iii.      .xap f ile
           This is Silverlight application package. It is generated when the Silverlight application project is built.
           An application package is a compressed zip file that has a .xap file extension and contains all the files
           that you need to start your application.

 iv.       The Silverlight application project will contain reference to the following assemblies

  v.       page files

           The Page class is used to create the user interface for the Silverlight application. The Page class
           derives from UserControl. You can implement the Page class by using Page.xaml for XAML markup
           and Page.xaml.cs or Page.xaml.vb for code-behind.

 vi.       App files

           The App class is required by a Silverlight application to display the application user interface. The
           App class is implemented by using App.xaml and App.xaml.cs or App.xaml.vb. The App class is
           instantiated by the Silverlight plug-in after the application package (.xap file) is created.

vii.       Test Page
        A single HTML page (TestPage.html) is generated to host your application if you select Dynamically
        generate an HTML test page to host Silverlight within this project option in the Add Silverlight
        Application dialog box.


Silverlight Application Project Web Site Files

        When we select the Add a new Web to the solution for hosting the control option in the Add
        Silverlight Application dialog box, an ASP.NET Web site is created and added to the Silverlight
        solution. The Web site contains the following files:

       Default files
        A default Web page that consists of the markup file Default.aspx and the code-behind file,
        Default.aspx.cs or Default.aspx.vb.

       Web.config
        A Web site configuration file.

       HTML file
        An HTML file that is used to configure and instantiate the Silverlight plug-in, which downloads and
        runs the Silverlight application. The name of this file is a concatenation of the name of the Silverlight
        application project and the text "TestPage.html".

       .aspx file
        A .aspx file which is the default startup Web page. The name of this file is a concatenation of the
        name of the Silverlight application project and the text "TestPage.aspx".

        Further Reading

Know Silverlight
    1. Find out what Silverlight is and where it fits. If you're just going to use it as a Flash replacement,
        there's no point.
    2. Learn layout controls: grid, stack and canvas to make a more custom user interface, learn about basic
        geometric shapes.
    3. Learn about the basic controls: buttons, radio buttons, and text boxes.
    4. Learn about event handling.
    5. To use lists, grids and stuff, learn about data binding and data collections.

6. Learn to make animations: in XAML, in C#, with Blender. Blender produces XAML code, but it's
    useful to understand how it works to be able to modify it. In C#.
7. Get the tools from
    To Learn More
8. Learn about accessing the HTML DOM from managed code.
9. Learn about networking and communication in Silverlight.
10. Learn using isolated storage and application settings.


To top