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

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

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

Editor's Notes

  • #2 &lt;SLIDETITLE INCLUDE=7&gt;Title Slide&lt;/SLIDETITLE&gt; &lt;KEYWORDS&gt;&lt;/KEYWORDS&gt; &lt;KEYMESSAGE&gt;&lt;/KEYMESSAGE&gt; &lt;SLIDEBUILDS&gt;0&lt;/SLIDEBUILDS&gt; &lt;SLIDESCRIPT&gt; Hello and Welcome to this MSDN session on “Building Applications with Visual Studio 2008 SP1.” My name is &lt;&lt;name&gt;&gt;. &lt;/SLIDESCRIPT&gt; &lt;SLIDETRANSITION&gt; &lt;TRANSITION LENGTH=7&gt; Let’s start this session by going into more detail on exactly what we will be covering. &lt;/TRANSITION&gt; &lt;/SLIDETRANSITION&gt; &lt;COMMENT&gt;&lt;/COMMENT&gt; &lt;ADDITIONALINFORMATION&gt; &lt;ITEM&gt;&lt;/ITEM&gt; &lt;/ADDITIONALINFORMATION&gt;