1 / 49

Stepping Outside the Browser with Silverlight 4

March 15, 2010. Ashish Shetty Program Manager | Microsoft Silverlight http://nerddawg.blogspot.com. Stepping Outside the Browser with Silverlight 4 . Why step outside the browser?. Give Your Apps a New Home. On Mac, Windows and elsewhere. More Options. Build immersive experiences.

doane
Download Presentation

Stepping Outside the Browser with Silverlight 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. March 15, 2010 Ashish Shetty Program Manager | Microsoft Silverlight http://nerddawg.blogspot.com Stepping Outside the Browser with Silverlight 4

  2. Why step outside the browser?

  3. Give Your Apps a New Home On Mac, Windows and elsewhere

  4. More Options Build immersive experiences

  5. Harness Local Data “Put the computation near the data” - Jim Gray

  6. Stepping outside the browser In Silverlight 3

  7. Rigid Security Sandbox Smart defaults Run same app in and out of browser

  8. Friction-free App Deployments With built-in updating

  9. Network Connectivity APIs Your app works on and off the grid

  10. Higher Local Storage Quotas 25MB Isolated Storage default gives you more room to stretch

  11. Basic Out of Browser App code | demo

  12. Stepping outside the browser In Silverlight 4

  13. Beyond the Browser in Silverlight 4 • Web Browser hosting • Window customization • Toast notifications • Offline DRM media playback • Silent install/uninstall support • Install-free “emulation mode” run • Trusted Apps New & Improved

  14. Web Browser Hosting Silverlight $ Web content

  15. WebBrowser Control • <WebBrowser Source="http://any.site" • Height="…" • Width="…"ScriptNotify="…" • /> • Navigate to URL • Get/Set markup as a string • 2-way interop • Supports browser plug-ins and doc objects • Flash, PDF, Visio etc. • “Windowed” hosting

  16. WebBrowser Brush • <WebBrowser Source="http://any.site" • x:Name="foo" • /> • … • <Rectangle> • <Rectangle.Fill> • <WebBrowserBrushSourceName="foo" • Opacity="0.5" • Stretch="…" /> • </Rectangle.Fill> • </Rectangle> • Enables layering of HTML and Silverlight • Opacity, rotation, effects, stretch/skew • HTML content is not-interactive

  17. Window Customization top, left • Startup location • Dimensions of client area • TopMost • Activate() and IsActive • Close() and Cancellable Closing event height width topmost

  18. “Toast” Notifications • Rectangular • 400 x 100 px max • 30 secs max • Can activate main window x You have 325 new voicemails Listen

  19. “Toast” Notifications NotificationWindow toast = new NotificationWindow(); toast.Content = new ToastContent(); toast.Content.MouseLeftButtonUp += (s, arg) => { Application.Current.MainWindow.Activate(); }; toast.Show(4000);

  20. Window Settings and “Toast” Notifications code | demo

  21. DRM Playback now works offline

  22. Silent install of apps • Enterprise installs via scripts, installers or executables sllauncher.exe /install:"somePath\myApp.xap" /origin:"http://any.site.com/myApp.xap" /shortcut:desktop+startmenu /overwrite sllauncher.exe /uninstall /origin:"http://any.site.com/myApp.xap" Platform Specific Usage

  23. Launch app without installing • For developer tools; Or if deploying via CD, DVD, USB media sllauncher.exe /emulate:"somePath\myApp.xap" /origin:"http://any.site.com/myApp.xap" /overwrite Platform Specific Usage

  24. Silverlight Trusted Applications Because not all apps can play in the sandbox File system access Device access Interop with external components Access to features not yet in Silverlight

  25. Trusted ApplicationSome things to remember • No trusted operations possible within the browser • Per-user app, not system-wide • Runs with standard user privileges, not admin • Great defense in depth with UAC on [recommended!] • No consent  No trust  No install • Group Policy hooks to disable install, activation • With great power comes great responsibility • Set expectations with consumer user • Sign your XAPs!

  26. Beyond the Browser in Silverlight 4Features for Trusted Apps Only… • Removed Sandbox speed bumps • File System Access • Native Integration • Window Chrome customizations • Digital Signing of XAPs New & Improved

  27. Removed Speed Bumps Cross-domain policy in networking sockets http &

  28. Removed Speed Bumps Socket port range restrictions 4502 - 4534

  29. Removed Speed Bumps Restrictions on full File path * OpenFileDialog SaveFileDialog &

  30. Removed Speed Bumps User initiation requirements

  31. Removed Speed Bumps Restrictions on Keyboard input in FullScreen mode Yes, really

  32. File System Access • Access to “My Files” • Documents • Pictures • Music • Videos • Types from System.IO • File • Directory • Environment • Etc.

  33. File System Access Creating a new video file // defensive code == portable code if(Application.Current.HasElevatedPermission) { // look ma, no path hard-coding! // this code works on Mac, Windows, everywhere stringpath = Environment.GetFolderPath( Environment.SpecialFolder.MyVideos); stringmediaFile = Path.Combine(path, "Foo.mp4"); if(!File.Exists(mediaFile) { using(FileStreamfs = File.Create(mediaFile)) { //... } } }

  34. Native Integration • … via Automation of external / system components • // defensive code == portable code • if (AutomationFactory.IsAvailable) { • dynamicxl = AutomationFactory.CreateObject("Excel.Application"); • xl.Visible = true; • xl.Workbooks.Add(); • //... • } Platform Specific Code coming soon 

  35. Automation Details

  36. Common Automation Services • Office interoperability • WMI (system information, file watching) • ADO DB • Sensors (GPS) • Speech • Etc. Consult Automation servers’ documentation

  37. Window Chrome Customization

  38. Trusted Application code | demo

  39. Digital Signing of XAPs • Applies to Trusted Apps only • Install and Update –time enforcements • Use Code Signing certificates

  40. Digital Signing of XAPs For consumers For app authors Better install-time UX App Icon Publisher name Seamless updates • Reassurance on authenticity and integrity of app • Clear publisher and provenance info on app Highly Recommended

  41. How to Digitally Sign XAPs Project Properties pane Command Prompt signtool.exe sign /v /f nameOfCert.pfx /p "<password>" nameOfApp.xap or

  42. Install-time consent promptsValid, Signed apps

  43. Install-time consent promptsUnsigned or self-signed apps

  44. With Silverlight… • Build sticky desktop experiences • More features outside the browser • Harness local data and provide immersive, latency-free experiences • …by putting the computation near the data

  45. Thank You! With a little help from our friends

  46. Questions?

  47. Credits • Matryoshka doll • http://www.flickr.com/photos/frangipani_photograph/3066995907 • Image courtesy of Frangipani Photograph • License: Creative Commons 2.0 (by-nc-nd) • Lock • http://www.flickr.com/photos/amagill/235453953/sizes/s/ • Image courtesy ofAmagill • License: Creative Commons 2.0 (by) • Phone connected to laptop • http://www.flickr.com/photos/re-ality/41676755/sizes/o/ • Image courtesy of re-ality • License: Creative Commons 2.0 (by) • Sandbox • http://www.flickr.com/photos/fenris/33546752/sizes/m/ • Image courtesy of abkfenris • License: Creative Commons 2.0 (by) • Children on slide • http://www.flickr.com/photos/sixthworld/3964450408/sizes/m/ • Image courtesy of Thomas Ott • License: Creative Commons 2.0 (by) • Cat stretch • http://www.flickr.com/photos/edvvc/483090647/sizes/m/ • Image courtesy of edvvc • License: Creative Commons 2.0 (by) • U.S. Declaration of Independence image is a public domain artifact from the National Archives • http://www.archives.gov/exhibits/charters/declaration.html • All logos and icons are trademarks of their respective owners, and are used here only to represent those products or brands

  48. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related