Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight

1,243 views

Published on

Published in: Technology, Economy & Finance
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,243
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • <SLIDETITLE INCLUDE=7>Title Slide</SLIDETITLE> <KEYWORDS></KEYWORDS> <KEYMESSAGE></KEYMESSAGE> <SLIDEBUILDS>0</SLIDEBUILDS> <SLIDESCRIPT> Hello and Welcome to this MSDN session on “Building Applications with Visual Studio 2008 SP1.” My name is <<name>>. </SLIDESCRIPT> <SLIDETRANSITION> <TRANSITION LENGTH=7> Let’s start this session by going into more detail on exactly what we will be covering. </TRANSITION> </SLIDETRANSITION> <COMMENT></COMMENT> <ADDITIONALINFORMATION> <ITEM></ITEM> </ADDITIONALINFORMATION>
  • Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight

    1. 1. Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight Frank La Vigne Lead Designer Applied Information Sciences http://www.franksworld.com
    2. 2. Ego Slide <ul><li>Frank La Vigne </li></ul><ul><ul><li>Microsoft MVP: Tablet PC </li></ul></ul><ul><ul><li>INETA Membership Mentor for DC, Maryland and Delaware </li></ul></ul><ul><ul><li>Manager/Founder Silverlight SIG </li></ul></ul><ul><ul><li>Lead Designer @ AIS </li></ul></ul><ul><ul><ul><li>Blog: www.franksworld.com </li></ul></ul></ul><ul><ul><ul><li>Company: www.appliedis.com </li></ul></ul></ul><ul><ul><ul><li>Twitter: @Tableteer </li></ul></ul></ul><ul><ul><li>Feedback to </li></ul></ul><ul><ul><ul><li>[email_address] </li></ul></ul></ul>
    3. 3. Goals
    4. 4. The 3 R’s of Client Development
    5. 5. Reach: The Web <ul><li>Widest possible reach </li></ul><ul><ul><li>From text only devices to desktops; from laptops to mobile phones; the web works just about anywhere </li></ul></ul><ul><li>Platform/Browser Independent* </li></ul><ul><ul><li>*Write once, test everywhere in every conceivable combination. </li></ul></ul><ul><li>Hard to debug </li></ul><ul><li>Easy to Deploy </li></ul><ul><li>User experience varies </li></ul>
    6. 6. Rich: Windows Client Application <ul><li>Richest experience possible </li></ul><ul><ul><li>Response time is instantaneous </li></ul></ul><ul><ul><li>WPF applications can leverage hardware acceleration for some truly engaging user experiences </li></ul></ul><ul><li>Easy to Debug </li></ul><ul><li>Narrow focus </li></ul><ul><li>Deployment concerns </li></ul>
    7. 7. RIA: Silverlight Applications <ul><li>Happy Medium of Reach and Rich </li></ul><ul><ul><li>Response time is instantaneous </li></ul></ul><ul><ul><li>Runs on Windows, Mac and Linux </li></ul></ul><ul><li>Easy to Debug </li></ul><ul><li>Wide focus </li></ul><ul><li>Easy deployment </li></ul><ul><li>Enables great user experiences </li></ul>
    8. 8. But Wait, There’s More!
    9. 9. The Fantastic Four of Client Technology
    10. 10. XBAP?
    11. 11. XBAP Defined <ul><li>Slightly Better Reach, a Lot More Rich </li></ul><ul><ul><li>All the benefits of Silverlight </li></ul></ul><ul><ul><li>The Power of WPF in a browser window </li></ul></ul><ul><ul><ul><li>3D, Drag & Drop, Printing, Hardware Acceleration </li></ul></ul></ul><ul><li>Easy to Debug </li></ul><ul><li>Easy deployment (Windows w/ .NET 3.x) </li></ul><ul><li>Enables great user experiences </li></ul>
    12. 12. When to Use XBAPs <ul><li>To quickly push a WPF app onto the web </li></ul><ul><li>When Management demands that applications be web based </li></ul><ul><li>When Windows is the client platform </li></ul><ul><ul><li>Ideal for corporate intranet </li></ul></ul><ul><ul><li>Specialized applications </li></ul></ul><ul><ul><li>Quickly moving a WPF application to the web </li></ul></ul>
    13. 13. &quot;Sawdust&quot;
    14. 14. How Can I Create an XBAP? <ul><li>Open Visual Studio 2008 </li></ul><ul><ul><li>File  New Project  WPF Browser Application </li></ul></ul>
    15. 15. How Do I Deploy an XBAP? <ul><li>In Visual Studio 2008 </li></ul><ul><ul><li>Build  Publish </li></ul></ul>
    16. 16. Deploying an XBAP: Mime Types
    17. 17. Let the LOLCats Guide Us Creating & Publishing an XBAP Application
    18. 18. 3-2-1 Launch!
    19. 19. Mostly the Same
    20. 20. But the Differences Will Get You
    21. 21. Caution: Eye Charts Ahead!
    22. 22. Different Feature Sets.. <ul><ul><li>3D </li></ul></ul><ul><ul><li>Documents </li></ul></ul><ul><ul><li>Drag Drop </li></ul></ul><ul><ul><li>Win32 Interop </li></ul></ul><ul><ul><li>Triggers </li></ul></ul><ul><ul><li>Commands </li></ul></ul><ul><ul><li>Printing </li></ul></ul><ul><ul><li>Logical tree </li></ul></ul><ul><ul><li>Adorners </li></ul></ul><ul><ul><li>Hosting WebBrowser </li></ul></ul><ul><ul><li>Deep Zoom </li></ul></ul><ul><ul><li>VC-1 codec </li></ul></ul><ul><ul><li>HTML integration </li></ul></ul><ul><ul><li>Sandbox </li></ul></ul><ul><ul><li>VideoBrush </li></ul></ul>
    23. 23. Graphics <ul><ul><li>Hardware acceleration </li></ul></ul><ul><ul><li>Graphics are </li></ul></ul><ul><ul><ul><li>Drawings </li></ul></ul></ul><ul><ul><ul><li>Streams </li></ul></ul></ul><ul><ul><ul><li>Shapes </li></ul></ul></ul><ul><li>Multi-core optimizations </li></ul><ul><li>Lighter weight visuals </li></ul><ul><li>Graphics are </li></ul><ul><ul><li>Shapes </li></ul></ul>
    24. 24. Property System <ul><ul><li>More inherited properties </li></ul></ul><ul><ul><ul><li>Extensible </li></ul></ul></ul><ul><ul><li>Property Metadata </li></ul></ul><ul><ul><li>Default Values </li></ul></ul><ul><ul><li>Coercion </li></ul></ul>
    25. 25. Resources <ul><ul><li>generic.xaml </li></ul></ul><ul><ul><li>Delayed instantiation of StaticResources </li></ul></ul><ul><ul><li>Merged Resource Dictionaries </li></ul></ul><ul><ul><li>FindResource walks the tree </li></ul></ul><ul><ul><li>Freezables </li></ul></ul><ul><ul><li>generic.xaml </li></ul></ul><ul><ul><li>XamlReader can load Resource Dictionaries. </li></ul></ul>
    26. 26. Databinding <ul><ul><li>UIElement to UIElement bindings </li></ul></ul><ul><ul><li>MultiBinding </li></ul></ul><ul><ul><li>Binding support at DependencyObject Dictionaries </li></ul></ul><ul><ul><li>Relative bindings </li></ul></ul><ul><ul><li>Template selectors </li></ul></ul><ul><ul><li>More Type converters out of the box </li></ul></ul><ul><ul><li>Binding support at FrameworkElement </li></ul></ul><ul><ul><li>No TargetType on data templates </li></ul></ul>
    27. 27. Eventing <ul><ul><li>Events are synchronous </li></ul></ul><ul><ul><li>Tunneling (Preview) events </li></ul></ul><ul><ul><li>Mouse Wheel </li></ul></ul><ul><ul><li>Events are asynchronous </li></ul></ul><ul><ul><li>Not all events bubble, even if declared as Routed </li></ul></ul>
    28. 28. Styles <ul><ul><li>Write-once </li></ul></ul><ul><ul><li>No app themes </li></ul></ul><ul><ul><li>No BasedOn </li></ul></ul><ul><ul><li>No triggers </li></ul></ul>
    29. 29. Templates <ul><ul><li>No TargetType </li></ul></ul><ul><ul><li>No template selectors </li></ul></ul>
    30. 30. Animation <ul><ul><li>MotionPath Animation </li></ul></ul><ul><ul><li>CompositionTarget.Rendering </li></ul></ul><ul><ul><li>More animatable types </li></ul></ul><ul><ul><li>Extensibility </li></ul></ul><ul><ul><li>Storyboard APIs added in 3.5 SP1 </li></ul></ul><ul><ul><li>Named key-frames </li></ul></ul><ul><ul><li>Storyboard APIs </li></ul></ul><ul><ul><ul><li>Begin, Stop, etc. </li></ul></ul></ul>
    31. 31. Input <ul><ul><li>Support for other platforms </li></ul></ul><ul><ul><li>Key.Unknown </li></ul></ul><ul><ul><li>ModifierKeys.Apple </li></ul></ul><ul><ul><li>KeyEventArgs.PlatformKeyCode </li></ul></ul>
    32. 32. Layout <ul><li>LayoutTransform </li></ul><ul><li>Text measures early </li></ul>
    33. 33. Other <ul><li>More markup-extensions </li></ul><ul><ul><ul><li>e.g. x:Static </li></ul></ul></ul><ul><li>More panels </li></ul><ul><li>Different Hit-Testing </li></ul><ul><li>LayoutRounding Property </li></ul><ul><li>No XamlWriter </li></ul><ul><li>No VisualBrush </li></ul><ul><li>No OnRender </li></ul>
    34. 34. Enough Slides! Code Time <ul><li>WPF  XBAP </li></ul><ul><li>WPF  Silverlight </li></ul>
    35. 35. Tips & Tricks for Recycling XAML <ul><li>Source compatibility ( not binary compatibility ) </li></ul><ul><ul><li>It is a different framework </li></ul></ul><ul><li>Code to Silverlight (Common Denominator) </li></ul><ul><li>Create a different VS project for each ‘run-time’ </li></ul><ul><ul><ul><li>Link the files together </li></ul></ul></ul><ul><li>Use WPF’s XML namespace declaration </li></ul><ul><li>xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; </li></ul>
    36. 36. Tips & Tricks for Recycling Source Code <ul><li>Use #if for small logic </li></ul><ul><ul><li>Move all conditional logic to code ( no #if in XAML ) </li></ul></ul><ul><li>Partial classes for larger chunks </li></ul><ul><ul><ul><li>Can use separate files altogether </li></ul></ul></ul><ul><li>Place Templates and styles in App.xaml (both platforms can pick from there) </li></ul>
    37. 37. Other API differences <ul><li>OpenFileDialog </li></ul><ul><ul><ul><li>SL = System.Windows.Controls </li></ul></ul></ul><ul><ul><ul><li>WPF: Microsoft.Win32 </li></ul></ul></ul><ul><li>Dispatcher.BeginInvoke different signatures </li></ul><ul><li>SL has more classes sealed ( can’t be inherited ) </li></ul><ul><li>XamlReader.Load </li></ul><ul><ul><ul><li>SL = XamlReader.Load ( string ) </li></ul></ul></ul><ul><ul><ul><li>WPF = XamlReader.Load ( stream ) </li></ul></ul></ul>
    38. 38. Other API differences (cont’d) <ul><li>ContentPresenter </li></ul><ul><ul><ul><li>SL : class ContentPresenter : Control </li></ul></ul></ul><ul><ul><ul><li>WPF : class ContentPresenter : FrameworkElement </li></ul></ul></ul><ul><li>UIElementCollection </li></ul><ul><ul><ul><li>SL : UIElementCollection : PresentationFrameworkCollection<UIElement> </li></ul></ul></ul><ul><ul><ul><li>WPF : UIElementCollection : IList, ICollection, Ienumerable </li></ul></ul></ul>
    39. 39. Silverlight User Group <ul><li>First Meeting is Wednesday, Feb 25 7:00 PM </li></ul><ul><li>www.caparea.net/silverlight </li></ul>
    40. 40. THANK YOU! Frank La Vigne www.FranksWorld.com [email_address]
    41. 41. Microsoft.com/tag
    42. 42. Session Summary <ul><li>We covered this </li></ul><ul><li>That </li></ul><ul><li>And the other thing! </li></ul>
    43. 43. For More Information <ul><li>Visit MSDN at http://msdn.microsoft.com </li></ul><ul><li>More information at: </li></ul><ul><li>http://anotherUrl </li></ul><ul><li>Subscribe to my blog: </li></ul><ul><li>http://msdn.microsoft.com/alias </li></ul>

    ×