SlideShare a Scribd company logo
1 of 39
Silverlight 2
Smart-Web-Clients with .NET

                      Max Knor
               Developer Evangelist
                   Microsoft Austria
              http://www.knor.net
What is Silverlight ?
• Browser-Plugin (4,63 MB)
   – Cross-Browser
   – Cross-Platform

• Embedded in an HTML page
                                           Rich UI
• Local Execution                           and
   – Smart-Client-Development             Flexible
                                        deployment
• Silverlight 2: integrated Mini-.NET
Developing for Silverlight
• XAML for UI-design (Expression Blend)
    <UserControl x:Class="SlApp.Page">
      ...
    </UserControl>

• .NET Code behind (Visual Studio)
    public partial class Page : UserControl
    {
      ...
    }
Structure of a Silverlight App
  Root                  <object type=
HTML/ASPX                   "application/x-silverlight-2-b1"
   File                      width="100%“ height="100%“ />



                 MyApp.XAP


 YourPage.XAML
                                         Resources
                 Assemblies
  YourPage.CS
Silverlight 2 - Runtime Features
•   2D, Graphics         • .NET Support
•   Audio, Video            – C# und VB.NET
•   Animations           • LINQ
•   Text, Text Input     • XML APIs
•   Controls             • HTML Integration
•   Layout
                            – JSON Serializer
•   Styles/Templates
                         • Local Storage
•   Data Binding
                         • Crypto APIs (AES)
•   Networking
    – HTTP/S & Sockets   • Threading
Silverlight 2 - SDK Libraries
• Dynamic Languages
    – JScript
    – IronRuby
    – IronPython
•   Additional Controls
•   LINQ for XML
•   XML Serialization
•   Syndication APIs (RSS)
Silverlight Futures
• Silverlight for Mobile
  – Based on 2.0: RTW in 2009
  – Windows Mobile, Nokia S40/S60


• Moonlight
Build an Application
•   Step 1: Get Data
•   Step 2: Convert XML data to .NET objects
•   Step 3: Build UI
•   Step 4: Save last search locally
•   Step 5: Access local data
Build an Application
• Step 1: Get Data
  – Network data from site of origin
  – Network data from cross domain (x-domain)
  – Local data
Silverlight Sandbox
• Silverlight lives in the browser Sandbox
• Developers cannot extend the sandbox
• Silverlight extends in a secure way
  – Local storage (isolated storage)
     • Similar to cookies
  – FileOpen dialog
  – Sockets
  – Cross domain HTTP(S) requests
     • Support Silverlight and Subset of Flash policy files
Build an Application
• Step 1: Get Data
  – Get data from http://catalog.video.msn.com/
  – Secured via a Silverlight policy file
demo
Networking
Build an Application
• Step 1: Get Data
• Step 2: Convert XML data to .NET objects
  – Options:
     • LINQ to XML
     • XMLReader
     • XML Serialization
demo
   Convert XML to Objects
(XML -> List<VideoSource>)
Build an Application
• Step 1: Get Data
• Step 2: Convert XML data to .NET objects
• Step 3: Build Main (Master) View
Build an Application
• Step 1: Get Data
• Step 2: Convert XML data to .NET objects
• Step 3: Build UI
Silverlight 2 Controls
• Canvas, Grid, StackPanel         Silverlight SDK
• FileOpenDialog                   • DataGrid
• Image, MediaElement,             • DatePicker, Calendar
  MultiScaleImage                  • TabControl, GridSplitter
• ListBox, ComboBox
• TextBox, PasswordBox             Silverlight Toolkit
• Button, HyperlinkButton          • WrapPanel, DockPanel
• CheckBox, RadioButton            • NumericUpDown
• Slider, ProgressBar, ScrollBar   • AutoCompleteBox
• TextBlock                        • TreeView
• ToolTip, Popup                   • ViewBox, Charts
demo
Build the UI
Build an Application
•   Step 1: Get Data
•   Step 2: Convert XML data to .NET objects
•   Step 3: Build UI
•   Step 4: Save last search locally
Local Storage
• „Power-Cookies”
• 10 MB ratio per Application
• More memory on reqest (user consent)

• Persistance past application runtime
• .NET Isolated Storage APIs
demo
Save last search locally
Build an Application
•   Step 1: Get Data
•   Step 2: Convert XML data to .NET objects
•   Step 3: Build UI
•   Step 4: Save last search locally
•   Step 5: Access local files
Open File Dialog
• End-Benutzer shares files
• Application gets access via streams (r/o)
• Multi-Selection (!)

• Usage:
  – File Uploads (with WebClient)
  – Display local files (Image, MediaElement)
demo
Play local video
HTML-DOM Integration
• Silverlight is hosted within HTML page

• Interop HTML <--> Silverlight important
  – JavaScript: Call Silverlight methods
  – Silverlight: Access HTML elements and JS
JavaScript --> Silverlight
[ScriptableType]
public class SharedClass
{
  [ScriptableMember()]
  public void SlMethod(string arg);
}

HtmlPage.RegisterScriptableObject("max", sc1);


document.getElementById("xaml1")
   .content.max.SlMethod("bla");
Silverlight --> JavaScript
HtmlElement el =
       HtmlPage.Document.GetElementById("bla");

el.SetAttribute("value", "Hallo");
el.AttachEvent("onclick", csEvent);


HtmlPage.Window.Eval("window.alert('Silverlight!');");
Image Deep Zoom
• Displays large images
• Seamless zooming / postloading

• Only necessary parts of image are loaded

• Behaviour like „Virtual Earth”
Image Deep Zoom
• Deep Zoom Composer cuts
  image in
  256 x 256 tiles

• Creates different zoom
  levels
Deep Zoom – How does it work?
• Lowest resolution displayed first
• Background download of higher quality tiles --
  > faded in smoothly
Deep Zoom – How does it work?
• Lowest resolution displayed first
• Background download of higher quality tiles --
  > faded in smoothly
Deep Zoom – How does it work?
• Lowest resolution displayed first
• Background download of higher quality tiles --
  > faded in smoothly
Image Deep Zoom
• MultiScaleImage Object

• Deep Zoom Composer
Silverlight
• Local execution:
  – Better UX than HTML / AJAX
  – Smart-Client-Development way
• Flexible Deployment (embedded in websites)

• Mini-.NET Framework
  – Well-Known APIs
  – XAML Subset of WPF
  – 4.5 MB vs. 80 MB
Start developing for Silverlight
• Visual Studio 2008 + SP1

• Silverlight Developer Package

• Expression Blend 2 + SP1

• Deep Zoom Composer
Start developing for Silverlight
• Silverlight Toolkit
• Silverlight Dashboards & Gauges




• Silverlight Contrib
Max Knor
http://www.knor.net/
Building Rich Internet Apps with Silverlight 2

More Related Content

What's hot

DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M users
Yoav Avrahami
 
Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1
drudolph11
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows Azure
Radu Vunvulea
 

What's hot (20)

Scaling wix to over 50 m users
Scaling wix to over 50 m usersScaling wix to over 50 m users
Scaling wix to over 50 m users
 
Evolution of the IBM Cloud Console: From Monolith to Microservices and Beyond
Evolution of the IBM Cloud Console: From Monolith to Microservices and BeyondEvolution of the IBM Cloud Console: From Monolith to Microservices and Beyond
Evolution of the IBM Cloud Console: From Monolith to Microservices and Beyond
 
DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M users
 
Running your CMS in the Cloud
Running your CMS in the CloudRunning your CMS in the Cloud
Running your CMS in the Cloud
 
Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1
 
Spring framework v2
Spring framework v2Spring framework v2
Spring framework v2
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows Azure
 
Turning Open Stack Swift Into A Rich Business Ready Cloud Service
Turning Open Stack Swift Into A Rich Business Ready Cloud ServiceTurning Open Stack Swift Into A Rich Business Ready Cloud Service
Turning Open Stack Swift Into A Rich Business Ready Cloud Service
 
Continuous Delivery at Wix
Continuous Delivery at WixContinuous Delivery at Wix
Continuous Delivery at Wix
 
End-to-end W3C APIs
End-to-end W3C APIsEnd-to-end W3C APIs
End-to-end W3C APIs
 
Microservices in Azure
Microservices in AzureMicroservices in Azure
Microservices in Azure
 
Data stores: beyond relational databases
Data stores: beyond relational databasesData stores: beyond relational databases
Data stores: beyond relational databases
 
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
 
AJAX the Great: The Origin and Development of the Dynamic Web (2007)
AJAX the Great: The Origin and Development of the Dynamic Web (2007)AJAX the Great: The Origin and Development of the Dynamic Web (2007)
AJAX the Great: The Origin and Development of the Dynamic Web (2007)
 
Building a serverless app
Building a serverless appBuilding a serverless app
Building a serverless app
 
Wix Architecture at Scale - QCon London 2014
Wix Architecture at Scale - QCon London 2014Wix Architecture at Scale - QCon London 2014
Wix Architecture at Scale - QCon London 2014
 
Introducing ADF Mobile - and Luc Bors(AMIS SIG, 12th November 2012)
Introducing ADF Mobile - and Luc Bors(AMIS SIG, 12th November 2012)Introducing ADF Mobile - and Luc Bors(AMIS SIG, 12th November 2012)
Introducing ADF Mobile - and Luc Bors(AMIS SIG, 12th November 2012)
 
Express yourself
Express yourselfExpress yourself
Express yourself
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo ThaiOGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
 

Similar to Building Rich Internet Apps with Silverlight 2

Presentation wpf
Presentation wpfPresentation wpf
Presentation wpf
danishrafiq
 
Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)
johnnybiz
 
Windows Phone 7 and Windows Azure – A Match Made in the Cloud
Windows Phone 7 and Windows Azure – A Match Made in the CloudWindows Phone 7 and Windows Azure – A Match Made in the Cloud
Windows Phone 7 and Windows Azure – A Match Made in the Cloud
Michael Collier
 
Webdev battacherjee
Webdev battacherjeeWebdev battacherjee
Webdev battacherjee
RavingTiger
 
HTML5 Programming
HTML5 ProgrammingHTML5 Programming
HTML5 Programming
hotrannam
 

Similar to Building Rich Internet Apps with Silverlight 2 (20)

Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8
 
HTML5 features & JavaScript APIs
HTML5 features & JavaScript APIsHTML5 features & JavaScript APIs
HTML5 features & JavaScript APIs
 
Building Rich Internet Applications Using Microsoft Silverlight 2, Part 2
Building Rich Internet Applications Using Microsoft Silverlight 2, Part 2Building Rich Internet Applications Using Microsoft Silverlight 2, Part 2
Building Rich Internet Applications Using Microsoft Silverlight 2, Part 2
 
Open web platform talk by daniel hladky at rif 2012 (19 april 2012 moscow)
Open web platform talk by daniel hladky at rif 2012 (19 april 2012   moscow)Open web platform talk by daniel hladky at rif 2012 (19 april 2012   moscow)
Open web platform talk by daniel hladky at rif 2012 (19 april 2012 moscow)
 
Working and Features of HTML5 and PhoneGap - An Overview
Working and Features of HTML5 and PhoneGap - An OverviewWorking and Features of HTML5 and PhoneGap - An Overview
Working and Features of HTML5 and PhoneGap - An Overview
 
Presentation wpf
Presentation wpfPresentation wpf
Presentation wpf
 
Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)
 
"BlackBerry Webworks : Apps for The Smartphone and Tablet"
"BlackBerry Webworks : Apps for The Smartphone and Tablet""BlackBerry Webworks : Apps for The Smartphone and Tablet"
"BlackBerry Webworks : Apps for The Smartphone and Tablet"
 
WebWorks Development for BlackBerry PlayBook and Smartphones
WebWorks Development for BlackBerry PlayBook and SmartphonesWebWorks Development for BlackBerry PlayBook and Smartphones
WebWorks Development for BlackBerry PlayBook and Smartphones
 
Windows Phone 7 and Windows Azure – A Match Made in the Cloud
Windows Phone 7 and Windows Azure – A Match Made in the CloudWindows Phone 7 and Windows Azure – A Match Made in the Cloud
Windows Phone 7 and Windows Azure – A Match Made in the Cloud
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devices
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech Day
 
Webdev battacherjee
Webdev battacherjeeWebdev battacherjee
Webdev battacherjee
 
Web works presso
Web works pressoWeb works presso
Web works presso
 
silverlight1.pptx
silverlight1.pptxsilverlight1.pptx
silverlight1.pptx
 
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalBuilding modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
 
HTML5 Programming
HTML5 ProgrammingHTML5 Programming
HTML5 Programming
 
Html5 phillycc
Html5 phillyccHtml5 phillycc
Html5 phillycc
 
Expert guide for PHP
Expert guide for PHPExpert guide for PHP
Expert guide for PHP
 

More from Microsoft Iceland

More from Microsoft Iceland (14)

Windows Server2008 R2 Overview (1)
Windows Server2008 R2 Overview (1)Windows Server2008 R2 Overview (1)
Windows Server2008 R2 Overview (1)
 
Windows Server2008 R2 Overview
Windows Server2008 R2 OverviewWindows Server2008 R2 Overview
Windows Server2008 R2 Overview
 
Virtualization: Hyper-V, VMM, App-V and MED-V.
Virtualization: Hyper-V, VMM, App-V and MED-V.Virtualization: Hyper-V, VMM, App-V and MED-V.
Virtualization: Hyper-V, VMM, App-V and MED-V.
 
Sql Server2008
Sql Server2008Sql Server2008
Sql Server2008
 
Scannata for Dynamics AX and OCR recognition
Scannata for Dynamics AX and OCR recognitionScannata for Dynamics AX and OCR recognition
Scannata for Dynamics AX and OCR recognition
 
Windows Small & Essential Business Server
Windows Small & Essential Business ServerWindows Small & Essential Business Server
Windows Small & Essential Business Server
 
Nav Strategy Bestof 2008
Nav Strategy Bestof 2008Nav Strategy Bestof 2008
Nav Strategy Bestof 2008
 
Intro To Live Framework
Intro To Live FrameworkIntro To Live Framework
Intro To Live Framework
 
Windows Azure introduction
Windows Azure introductionWindows Azure introduction
Windows Azure introduction
 
AX 2009 Demo Supply Chain Mgmt
AX 2009 Demo Supply Chain MgmtAX 2009 Demo Supply Chain Mgmt
AX 2009 Demo Supply Chain Mgmt
 
Crm Solution Areas X Rm And Vertical Solutions
Crm Solution Areas X Rm And Vertical SolutionsCrm Solution Areas X Rm And Vertical Solutions
Crm Solution Areas X Rm And Vertical Solutions
 
Application Lifecycle Management & VSTS
Application Lifecycle Management & VSTSApplication Lifecycle Management & VSTS
Application Lifecycle Management & VSTS
 
What The Cloud Is My Cio Thinking 2009
What The Cloud Is My Cio Thinking 2009What The Cloud Is My Cio Thinking 2009
What The Cloud Is My Cio Thinking 2009
 
Keynote Day 1 2009
Keynote Day 1 2009Keynote Day 1 2009
Keynote Day 1 2009
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Building Rich Internet Apps with Silverlight 2

  • 1.
  • 2. Silverlight 2 Smart-Web-Clients with .NET Max Knor Developer Evangelist Microsoft Austria http://www.knor.net
  • 3. What is Silverlight ? • Browser-Plugin (4,63 MB) – Cross-Browser – Cross-Platform • Embedded in an HTML page Rich UI • Local Execution and – Smart-Client-Development Flexible deployment • Silverlight 2: integrated Mini-.NET
  • 4. Developing for Silverlight • XAML for UI-design (Expression Blend) <UserControl x:Class="SlApp.Page"> ... </UserControl> • .NET Code behind (Visual Studio) public partial class Page : UserControl { ... }
  • 5. Structure of a Silverlight App Root <object type= HTML/ASPX "application/x-silverlight-2-b1" File width="100%“ height="100%“ /> MyApp.XAP YourPage.XAML Resources Assemblies YourPage.CS
  • 6. Silverlight 2 - Runtime Features • 2D, Graphics • .NET Support • Audio, Video – C# und VB.NET • Animations • LINQ • Text, Text Input • XML APIs • Controls • HTML Integration • Layout – JSON Serializer • Styles/Templates • Local Storage • Data Binding • Crypto APIs (AES) • Networking – HTTP/S & Sockets • Threading
  • 7. Silverlight 2 - SDK Libraries • Dynamic Languages – JScript – IronRuby – IronPython • Additional Controls • LINQ for XML • XML Serialization • Syndication APIs (RSS)
  • 8. Silverlight Futures • Silverlight for Mobile – Based on 2.0: RTW in 2009 – Windows Mobile, Nokia S40/S60 • Moonlight
  • 9. Build an Application • Step 1: Get Data • Step 2: Convert XML data to .NET objects • Step 3: Build UI • Step 4: Save last search locally • Step 5: Access local data
  • 10. Build an Application • Step 1: Get Data – Network data from site of origin – Network data from cross domain (x-domain) – Local data
  • 11. Silverlight Sandbox • Silverlight lives in the browser Sandbox • Developers cannot extend the sandbox • Silverlight extends in a secure way – Local storage (isolated storage) • Similar to cookies – FileOpen dialog – Sockets – Cross domain HTTP(S) requests • Support Silverlight and Subset of Flash policy files
  • 12. Build an Application • Step 1: Get Data – Get data from http://catalog.video.msn.com/ – Secured via a Silverlight policy file
  • 14. Build an Application • Step 1: Get Data • Step 2: Convert XML data to .NET objects – Options: • LINQ to XML • XMLReader • XML Serialization
  • 15. demo Convert XML to Objects (XML -> List<VideoSource>)
  • 16. Build an Application • Step 1: Get Data • Step 2: Convert XML data to .NET objects • Step 3: Build Main (Master) View
  • 17. Build an Application • Step 1: Get Data • Step 2: Convert XML data to .NET objects • Step 3: Build UI
  • 18. Silverlight 2 Controls • Canvas, Grid, StackPanel Silverlight SDK • FileOpenDialog • DataGrid • Image, MediaElement, • DatePicker, Calendar MultiScaleImage • TabControl, GridSplitter • ListBox, ComboBox • TextBox, PasswordBox Silverlight Toolkit • Button, HyperlinkButton • WrapPanel, DockPanel • CheckBox, RadioButton • NumericUpDown • Slider, ProgressBar, ScrollBar • AutoCompleteBox • TextBlock • TreeView • ToolTip, Popup • ViewBox, Charts
  • 20. Build an Application • Step 1: Get Data • Step 2: Convert XML data to .NET objects • Step 3: Build UI • Step 4: Save last search locally
  • 21. Local Storage • „Power-Cookies” • 10 MB ratio per Application • More memory on reqest (user consent) • Persistance past application runtime • .NET Isolated Storage APIs
  • 23. Build an Application • Step 1: Get Data • Step 2: Convert XML data to .NET objects • Step 3: Build UI • Step 4: Save last search locally • Step 5: Access local files
  • 24. Open File Dialog • End-Benutzer shares files • Application gets access via streams (r/o) • Multi-Selection (!) • Usage: – File Uploads (with WebClient) – Display local files (Image, MediaElement)
  • 26. HTML-DOM Integration • Silverlight is hosted within HTML page • Interop HTML <--> Silverlight important – JavaScript: Call Silverlight methods – Silverlight: Access HTML elements and JS
  • 27. JavaScript --> Silverlight [ScriptableType] public class SharedClass { [ScriptableMember()] public void SlMethod(string arg); } HtmlPage.RegisterScriptableObject("max", sc1); document.getElementById("xaml1") .content.max.SlMethod("bla");
  • 28. Silverlight --> JavaScript HtmlElement el = HtmlPage.Document.GetElementById("bla"); el.SetAttribute("value", "Hallo"); el.AttachEvent("onclick", csEvent); HtmlPage.Window.Eval("window.alert('Silverlight!');");
  • 29. Image Deep Zoom • Displays large images • Seamless zooming / postloading • Only necessary parts of image are loaded • Behaviour like „Virtual Earth”
  • 30. Image Deep Zoom • Deep Zoom Composer cuts image in 256 x 256 tiles • Creates different zoom levels
  • 31. Deep Zoom – How does it work? • Lowest resolution displayed first • Background download of higher quality tiles -- > faded in smoothly
  • 32. Deep Zoom – How does it work? • Lowest resolution displayed first • Background download of higher quality tiles -- > faded in smoothly
  • 33. Deep Zoom – How does it work? • Lowest resolution displayed first • Background download of higher quality tiles -- > faded in smoothly
  • 34. Image Deep Zoom • MultiScaleImage Object • Deep Zoom Composer
  • 35. Silverlight • Local execution: – Better UX than HTML / AJAX – Smart-Client-Development way • Flexible Deployment (embedded in websites) • Mini-.NET Framework – Well-Known APIs – XAML Subset of WPF – 4.5 MB vs. 80 MB
  • 36. Start developing for Silverlight • Visual Studio 2008 + SP1 • Silverlight Developer Package • Expression Blend 2 + SP1 • Deep Zoom Composer
  • 37. Start developing for Silverlight • Silverlight Toolkit • Silverlight Dashboards & Gauges • Silverlight Contrib