Live WebCast: Discovering Silverlight 2.0 – Developing RIA Solutions (Part 1 of 5)

   As I wrote in the previous post this post will be part of a Portuguese WebCasts Cycle  and in this case the topic is:

            “Developing RIA Solutions”

    This session had the purpose of presenting an overview of the capabilities and functionalities of Silverlight 2.0, and the talked topics were:

    1. Introduction

               Silverlight 2.0 in the same way that his predecessor, version 1.0, is still a Cross-Browser (IE, Firefox, Safari, Opera) and Cross-Platform (Windows, MAC OS, Linux), allowing rich experiences in terms of Media, and now this versions allows also the needed functionalities and possibilities to develop Line-of-Business solutions in a connected environment, and so there’s no support for “Occasionally Offline” or even “Occasionally Online”, as I wrote in this previous post.

               Basically with this new version we have all the previously known elements and also the following:

      • CLR – Common Language Runtime – This is the .NET Framework embedded on the Silverlight solutions that will allow that you can use .Net languages on the Code-Behind.
      • DLR – Dynamic Language Runtime – This enables a runtime for the usage of Dynamic Languages like IronPython and IronRuby.
      • Controls, in this version by default its made available a complete set of controls in order to help on the LOB solution development, controls such as DataGrid, ComboBox, RadioButton, Calendar, etc.
      • Layout – A set of controls that allow you to define how the controls will be arranged on the solution, and so more than a Canvas (basically a surface for placing object) we now have also a Grid (that allows us to define rows and columns in a way to organize how the controls used will be arranged on the application), StackPanel (Panel that will automatically arrange the contents) and the Border (this allow us to customize the boundaries of the surface area).
      • Editing – Availability of Controls that allow the edition of data like the TextBox.
      • SOAP, WCF, REST, Sockets – Allow us to consume all kinds of services.
      • XMLReader/XMLWriter – Allows us to process XML files on Silverlight.
      • LINQ – Allows the usage of Linq to XML on Silverlight.
      • DRM – Digital Rights Management – This is a mechanism to manage the rights digitally and that is very important in Media solutions.

    2. Application Model

               Silverlight works on a statefull model, and that means that unlike the usual Internet based solutions, it maintains the state. This happens because when the first request is made the solution is served to the client machine, working in a similar way as the Forms solutions.

               The way that the solution is compiled is the following:

      1. When the compolation is made by using the csc.exe (C# Compiler) or the vbc.exe (VB.NET compiler) all the source code, XAML files and also the Media files described as Embedded Resources will be packed in an Assembly that will be the result of the compilation process.
      2. It’s also generated a file with the XAP extension (basically a compressed Zip file with all the needed files) that will be the package of all the elements needed for the solution, and those elements are:
        • Assembly generated on the first point
        • Assemblies that are used as references on the solution
        • Media Eklements placed as content on the solution
        • Manifest.xml file that will contain all the information about the solution and there contents.

               The needs in terms of the Server are that we need to register the following extensions:

      • .XAP with the Mime Type of Application/x-silverlight-app – this will notify the Web Server that whenever he receives a request to serve this type of file he should serve the file that is the Silverlight Application.
      • .XAML with the Mime Type of application/xaml+xml – this will notify that this is a Silverlight page. This is only needed when the Silverlight 1.0 version is used or whenever there is a Spash Screen for a Silverlight version 2.0 solution.

               As for the install and instantiation process what happens is the following:

      • Install 
        • This is made only once
        • It will be on Windows Update after the RTM release, and this will allow the increase of the adoption.
        • The updates are made automatically
        • The Install Experience is 100% customizable (http://silverlight.net/Quickstarts/BuildUi/SplashScreen.aspx)
        • There’s no need for a Browser restart in order to start working

 

      • Instantiation 
        • Using the HTML Object Tag
        • Silverlight.js – Javascript file used to instantiate the Silverlight solution

    3. Features

               Some of the features are:

      • Full Screen Mode
        • Possibility of viewing the solution on Full Screen, and in this way it will be free of the Browser chrome, but there will be a limit on the input as only the following keys will be available:Left, Right, Up, Down, Page Up, Page Down, Tab, Home, End.

 

      • Security 
        • In the same way that in version 1.0, this version works inside a Security SandBox that will avoid malicious code from affecting the critical resources of the customer system.
        • Elements that allow this kind of security:
          • Cross Domain – Allows the definition of the permissions whenever calls that need to cross boundaries are made, and they could be cross domain boundaries or even Browser Zone Boundaries.
          • Isolated Storage – Makes possible the usage of a safe place that will allow IO operations without decreasing the security of the customer.
          • Sockets – The need of specifying the cross domain policy file in order to make the call will make the solutions a lot more secure.
          • OpenFileDialog – Allows us to visualize the contents of the customer machine without needing to give dangerous permission to the solution.
        • It doesn’t need Administration privileges because it works in least privileges needed mode.
        • Is possible to have several instances of Silverlight in the same page, as each one will have it’s own AppDomain maintaining the independence between them.

 

      • HTML DOM Integration
        • Allow the integration between Silverlight and DOM, and what it means is that we can access Silverlight contents from the browser and vise-versa.

 

      • Deep Zoom
        • Allows the possibility of viewing high resolution images with a high performance even when making zoom on them.
        • Reads only the needed parts of the image that is being viewed.

 

    4. Tools

               The suggested tools for the development are Visual Studio (Developers) and Microsoft Expression Studio (Designers).

 

    5. Controls

               This was one of the big issues associated with Silverlight 1.0 and for that reason this version have several controls by default that are made available even with the source code and can be extended. There are 2 ways to change the looks, and they are:

      • Styling
        • Changing the appearance  using only the available properties
      • Skinning
        • Changing all the components that make the control appearance with a full and complete creative freedom.

 

    6. Data Binding

               Allows us to make connection between properties and other elements on the solution, and can be done in 2 ways:

    • Declaratively

                       <TextBlock Text="{Binding Nasdaq.Points, Mode=OneWay}"/>

    • Programmatically

                        Binding binding = new Binding("Nasdaq.Points");

                        binding.Mode = BindingMode.OneWay;

                        TextBlock tb = new TextBlock();

                        tb.SetBinding(TextBlock.TextProperty, binding);

 

    To finalize I would only place the resources presented:

     Here is also available my presentation and the samples made.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

* Copy This Password *

* Type Or Paste Password Here *

1,568 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>