Building Rich Internet Applications Using Microsoft Silverlight

21
Building Rich Internet Applications Using Microsoft Silverlight Saurabh Pant blogs.msdn.com/ saurabh

description

Building Rich Internet Applications Using Microsoft Silverlight. Saurabh Pant blogs.msdn.com/saurabh. Agenda. Overview Getting Started Build an Application Networking XML Parsing Controls Data Binding Local Storage OpenFileDialog Q&A. Silverlight 1.0. Silverlight 2.0. - PowerPoint PPT Presentation

Transcript of Building Rich Internet Applications Using Microsoft Silverlight

Page 1: Building Rich Internet Applications Using Microsoft Silverlight

Building Rich Internet Applications Using Microsoft

Silverlight

Saurabh Pantblogs.msdn.com/saurabh

Page 2: Building Rich Internet Applications Using Microsoft Silverlight

Agenda• Overview• Getting Started• Build an Application

– Networking– XML Parsing– Controls– Data Binding– Local Storage– OpenFileDialog

• Q&A

Page 3: Building Rich Internet Applications Using Microsoft Silverlight

Silverlight 1.0

Page 4: Building Rich Internet Applications Using Microsoft Silverlight

Silverlight 2.0

Page 5: Building Rich Internet Applications Using Microsoft Silverlight

Silverlight 2.0 Features• 2D, Graphics • Audio, Video• Animations• Text, Text Input• Controls• Layout• Styles/Templates• Data Binding• Networking

– HTTP/S and Sockets

• .NET Support– C# and VB.NET

• LINQ• XML APIs• Generics• HTML Integration

– JSON Serializer• Local storage• Crypto APIs (AES)• Threading

*Feature in bold part of Silverlight 1.0

Page 6: Building Rich Internet Applications Using Microsoft Silverlight

Silverlight Roadmap

• Silverlight V1.0 Shipped Q307• Silverlight V2.0– Beta 1 Q108 [non-commercial go-live]– Beta 2 [go live]

• Tools– Expression Suite and Visual Studio Silverlight

support available – Interactive Designer support in Visual Studio later

this year

Page 7: Building Rich Internet Applications Using Microsoft Silverlight

Packaging

• Code is compiled into assemblies (.dll)• XAML is embedded into assembly• Application is packaged into ZIP archive– File extension: .xap

• Advantages– Reduces on-the-wire size, faster disk I/O– Easy to generate, update

• Flexible packaging model– Assemblies and resources can be demand loaded

Page 8: Building Rich Internet Applications Using Microsoft Silverlight

Silverlight Sandbox

• Silverlight Apps lives in the browser Sandbox• Developers cannot extend the sandbox• Silverlight extends it in a secure way– Local storage– FileOpenDialog– Sockets– Cross domain HTTP(S) requests

Page 9: Building Rich Internet Applications Using Microsoft Silverlight

Build an Application

• Step 1: Get Data• Step 2: Convert XML data to .NET objects• Step 3: Build Main (Master) View• Step 4: Create a Details View• Step 5: Use Local Storage• Step 6: Use FileOpenDialog

Page 10: Building Rich Internet Applications Using Microsoft Silverlight

MSN Video Service

• Video Catalog at http://catalog.video.msn.com/

• Secured via a Silverlight policy file

Page 11: Building Rich Internet Applications Using Microsoft Silverlight

List Binding with Data Templates

{{FileName=“Html.html”, FileImageUrl=“html.jpg”},{FileName=“Image.jpg”, FileImageUrl=“jpg.jpg”}}

Data Template:

Data (.NET Object):

Bind using ItemsControl (List Control):

Page 12: Building Rich Internet Applications Using Microsoft Silverlight

Silverlight MIX 08 Sessions http://sessions.visitmix.com

• Scott Guthrie Key Note

• Building Rich Internet Applications in SL 2.0 - Part I & II

• Integrating Media in Silverlight Applications

• Encoding Video for Microsoft Silverlight Delivery Scenarios

• Creating Rich, Dynamic User Interfaces with Silverlight 2 Controls

• Silverlight and the Advertising Opportunity

• Working with Data and Web Services in Microsoft Silverlight 2.0

• Extending the browser programing model with Sliverlight

• Lighting Up Your AJAX Applications with Silverlight

Page 13: Building Rich Internet Applications Using Microsoft Silverlight

Backup

Page 14: Building Rich Internet Applications Using Microsoft Silverlight

Data Binding

• Property Binding–One way, two way and one time–Use “DataContext” property– Supports value converters

• Collection/List Binding– Support data templates (repeater)–Use “ItemsSource” property

Page 15: Building Rich Internet Applications Using Microsoft Silverlight

Deep Zoom

• Provides seamless viewing & zooming of huge images

• Loads only the data necessary to show the part of an image the user is viewing

• Effectively turns a large image into an efficiently scaling vector

Page 16: Building Rich Internet Applications Using Microsoft Silverlight

Deep Zoom– How does it work?

Uses tiled image pyramidsThe overhead of pyramids is 33%:

Page 17: Building Rich Internet Applications Using Microsoft Silverlight

Deep Zoom – How does it work?

Preprocessing tool breaks image into 256 x 256 tilesThen generates pyramids of tiles at lower resolutions

Page 18: Building Rich Internet Applications Using Microsoft Silverlight

Deep Zoom– How does it work?

• When the image is displayed on the client the lowest resolution tiles are shown first

• Then as the higher quality tiles are downloaded, they are smoothly blended in

Page 19: Building Rich Internet Applications Using Microsoft Silverlight

Deep Zoom– How does it work?

• When the image is displayed on the client the lowest resolution tiles are shown first

• Then as the higher quality tiles are downloaded, they are smoothly blended in

Page 20: Building Rich Internet Applications Using Microsoft Silverlight

Deep Zoom– How does it work?

• When the image is displayed on the client the lowest resolution tiles are shown first

• Then as the higher quality tiles are downloaded, they are smoothly blended in

Page 21: Building Rich Internet Applications Using Microsoft Silverlight

Deep Zoom in Silverlight

• Exposed through the MultiScaleImage• Preprocessing tool outputs image tiles and

XML description file• Working with the Expression team to get this

into the next version of Blend