1 / 71

Developing Windows and Web Applications using Visual Studio.NET Session #9: Silverlight

Developing Windows and Web Applications using Visual Studio.NET Session #9: Silverlight. Gerard Beckerleg. Admin Stuff. Attendance You initial sheet Hands On Lab You get me to initial sheet Certificate At end of 10 sessions If I say if you have completed successfully . Last week.

ranger
Download Presentation

Developing Windows and Web Applications using Visual Studio.NET Session #9: Silverlight

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. Developing Windows and Web Applications using Visual Studio.NETSession #9: Silverlight Gerard Beckerleg

  2. Admin Stuff • Attendance • You initial sheet • Hands On Lab • You get me to initial sheet • Certificate • At end of 10 sessions • If I say if you have completed successfully 

  3. Last week • Reporting • ASP.NET MVC

  4. Last week - Additional • Connectionstring • (local)vslocalhostvs. • http://weblogs.asp.net/jgalloway/archive/2005/12/02/432062.aspx • Shared memory comes always first on local machine • http://msdn.microsoft.com/en-us/library/ms187662.aspx

  5. Agenda • Silverlight • Rich interactivity

  6. C -Silverlight Fun

  7. Agenda - Silverlight • Why Silverlight? • RIA Competitors • Getting started with Silverlight • Silverlight under the hood • Cool stuff • Pros / Cons

  8. Microsoft Silverlight is a cross-browser, cross-platform implementation of .NET for building and delivering the next generation of media experiences & rich interactive applications for the Web.

  9. Pain with web applications

  10. How a web page is shown Your Computer Hosting Computer Internet The Internet Client Server

  11. All of the intelligence and data is on the server Request www.ssw.com.au The Internet Response HTML Client Server

  12. Typical Client Server • Typical Client Server

  13. Typical Silverlight • Typical Client Server

  14. Pain with web applications • Developers - UI is hard to develop • Testing - Different browser  different UI • Performance - Request / Response • Scalability - Server based • Intelligence on the client requires JavaScript/jQuery Bottom line: The browser sux

  15. We want • Easy to develop and maintain • Write once, run anywhereJava slogan, when Sun introduced Java 1.0 1996 • Awesome User experience  • Look • Feel • Usability

  16. RIA - Rich Internet Applications PX

  17. The Answer: Rich Internet Applications • Side step the browser • Features/functionality of traditional desktop applications • State maintained on BOTH client and server • Run within a secure web browser environment (a sandbox) • No additional software installation • http://www.mscui.net/PatientJourneyDemonstrator/

  18. RIA • Initial Download • Stateful client - Changes to the view don't require [re]loading a new page • Engine – browser extension • Program logic (executes compiled programs) • Rendering user interface • Server communication

  19. Silverlight = RIA from MS • Cross platform • Browser plug in • Rich Internet Application • .NET / CLR in the browser (VB/C#) • 4MB download • Simple install • Competes with other products

  20. User Expectations UI Quality

  21. What platform • Choice of platform based on richness vs. reach • Goal: Parity in developer productivity Richness Reach

  22. What platform • Choice of platform based on richness vs. reach • Goal: Parity in developer productivity Richness Reach

  23. Silverlight "History" • 2000 ~ .NET • .NET platform for Windows and Web applications • AJAX: Web feel like Desktop • WPF: (Windows Presentation Foundation) • Separate UI from Code • Too much • Not Cross browser • WPFe (everywhere) • Silverlight

  24. Silverlight 1 and 2 • Show videos like flash • Implementing the same full (CLR) version as .NET Framework 3.0 (SL2) • Its compiled into .NET assemblies which are then compressed using ZIP and stored in a .xapfile (SL2) •  Includes Deep Zoom, a technology (SL2)

  25. Silverlight 3 • Data binding • SupportsAdvanced Audio Coding (AAC) • SupportsOut-of-Browser experiences • ClearType text rendering

  26. Silverlight 4 • RIA services. • Web cam and microphone support. • Printing support. • New and enhanced controls such as a RichTextBox and an enhanced DataGrid control.

  27. RIA Competitors • HTML 5 • Adobe Flash, Flex • Flash: Technology for animations • Flex: Collection of tools to dev Flash apps • Java applets / applications • JavaScript / AJAX • Google's GWT framework (Google Web Toolkit) • JQuery • Microsoft Silverlight

  28. "Hello World" in Silverlight

  29. Visual Studio files by default

  30. "Hello World" - XAML <UserControl x:Class="SilverlightApplicationHelloWorld.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400" Height="300"> <StackPanel> <Button Width="400" Height="20" Content="Click me" Click="Button_Click"></Button> <TextBlock x:Name="textblockOutput" Width="400" Height="20" Text="empty"></TextBlock> </StackPanel> </UserControl>

  31. "Hello World" – XAML in Design mode

  32. "Hello World" private void Button_Click(object sender, RoutedEventArgs e) { textblockOutput.Text = "Hello World"; }

  33. "Hello World" – Running app

  34. Silverlight – Under the hood

  35. Silverlight Build Process

  36. XAML Defines .Net Objects <TextBlockFontSize="32" Text="Hello world" /> • ≡ TextBlock t = new TextBlock(); t.FontSize = 32; t.Text = "Hello world";

  37. XAML • XML eXtensible Mark-up Language • X Application ML • UI mark-up language • Used in • Silverlight, WPF (and Work Flow) • Tools • Visual Studio, Expression Blend, Notepad • Can generate UI with code or XAML (faster)

  38. Access Elements from Code • Name your XAML elements <Rectangle x:Name="rectOne" /> void OnMouseEnter(object sender, MouseEventArgs e) { rectOne.Height= 75; }

  39. Silverlight Tooling • Expression • Design • Blend 4 • Visual Studio • Visual Studio 2010 • Silverlight Tools for Visual Studio 2010 • Silverlight SDK

  40. Silverlight Limitations • PIX

  41. Silverlight Limitations #1 • No full access to Windows API & .NET API • Silverlight is a subset of .NET framework • WPF features not in Silverlight: • http://msdn.microsoft.com/en-us/library/cc903925(VS.95).aspx • Hardware acceleration • 3D graphics • Resources • Drawing types • Flow text • Doc Panel • Triggers

  42. Silverlight Limitations #2 • Hosting Silverlight • in Windows Forms application • In Office • No sandbox customization • No external API calls (e.g. P/Invoke, COM, full .NET) • No Office integration

  43. Silverlight Limitations #3 • No Secure SaveAs dialog *FIXED IN SL3* • SL3 introduced a secure SaveAs dialog

  44. Silverlight Limitations #4 • Offline support *FIXED IN SL4* • SL4 introduced Isolated Storage • No Sync Framework – manual code • No local DB – no normal SQL • Out of Browser support although more limited than WPF • http://sharepoint.ssw.com.au/Standards/SoftwareDevelopment/RulesToBetterSilverLight/Pages/Doyouofferout-of-browsersupport.aspx

  45. Silverlight Limitations #5 • No Context menu • No Right Click Event • No context menu triggered by Right Click. • Hacks exists but are not recommended due to the need to put the SL plug-in in windowless mode, introducing performance issue • No “Right click – Open in new tab”

  46. Silverlight Limitations #6 • No printing support • Server side PDF or Open XML generation • Client side manual HTML generation. Need to implement the formatting logic twice one for XAML and one for HTML • Final version of SL 3 should provide more “hacks” for generating bitmaps from visuals enabling some more options for client side printing compared to the manual HTML generation. Still done through HTML bridge. This will for example enable printing of Charts.

  47. Silverlight Limitations #7 • Cross domain access • http://weblogs.asp.net/jgalloway/archive/2008/12/12/silverlight-crossdomain-access-workarounds.aspx

  48. Silverlight Cool

  49. Silverlight Cooool • Business Apps • http://www.mscui.net/PatientJourneyDemonstrator • Cool SL games • http://www.silverarcade.com/ • Silverlight shop • http://www.eastberlinshop.com/

More Related