210 likes | 343 Views
PC27. Silverlight And WPF Sharing skills and code. Ian Ellison-Taylor General Manager Microsoft Corporation. Why not one thing? . Different Scenarios Desktop applications Web apps/RIAs Mobile phone applications Server applications Different requirements Size & Performance
E N D
PC27 Silverlight And WPFSharing skills and code Ian Ellison-Taylor General Manager Microsoft Corporation
Why not one thing? • Different Scenarios • Desktop applications • Web apps/RIAs • Mobile phone applications • Server applications • Different requirements • Size & Performance • Technical limitations • Platform differences • Browser differences
High-Level Goals • Build rich applications • … using the same people • … with the same skills • … with the same workflow • … with common code
Deciding what to use when • .NET Framework is the best desktop app platform • Silverlight is the best RIA platform • Silverlight is smaller-lighter • Easier to deploy • But you reuse your skills and code between them
Getting started • SL to Full .NET is easier than Full .NET to SL • Full .NET To SL: Share lots of knowledge • Unlearn APIs that don’t exist in Silverlight • Porting code is harder • .NET Framework has features not in Silverlight • Some of those are BIG feature areas • Some of those are small differences
demo Twitter Sample
BIG STUFF Microsoft Confidential
Features In Common • XAML • Vector graphics • Intrinsic controls • Styles and control templating • Video (media) • Animations • Mouse and keyboard • Text display • Layout
Only In .NET Framework • Desktop integration • Offline and out of browser • Full trust (security) • Interop with WinForms and Win32 and DirectX • Image editing • Media encoding (DirectShow) • Flow documents e.g. NYT • Rich text stack e.g. ligatures, spell-checking • Full access to hardware: 3D, Tablet, Speech, and Microphone • Plug-in model • Hosting the browser • Navigation model • Shader Effects • UI Data-binding support
Only In Silverlight 2 • Specific media features • Timeline markers, VideoBrush, and multi-bitrate support • Multiscale image • Full HTML DOM integration
Recent Changes • Silverlight 2 • Xmlns now match • DependencyProperty.Register(…, …, …, callback); • Improved control templating • Databinding validation • RoutedEventArgs.Handled • Lots of API signature fixes and future proofing • WPF 3.5sp1 • Adds Storyboard.Begin() • Storyboard.SetTarget(storyboard, element) • Shared clocks, animation hold
Details Microsoft Confidential
VS Project Files • Can’t use Silverlight DLL in a .NET FX project or vice versa • Source compatible, not binary compatible • A VS project file (.csproj/.vbproj) compiles either Silverlight or .NET FX but not both
Missing Controls • DataGrid, Calendar, and DatePicker • Coming soon • HyperlinkButton • Can do as an add-on pack
Control Templates • VSM Control templates for SL controls don’t work in .NET FX 3.5 • Trigger templates for WPF controls don’t work in SL • .NET Framework/WPF to add support for SL (VSM) model after .NET 3.5sp1 • See Karen VSM talk and HOL for more details
Other • Differences • Silverlight font loading from .xap only • OpenFileDialog differences • SL supports non-windows keys • SL has fewer Markup Extensions • {x:Type}, {x:Null}, {StaticResource}, and {Binding} • Attributes instead of XML Text values (generally) • Not in SL • Stylus • MergedDictionaries • Dynamic Styles
Subtle Differences • Double to float in graphics happens earlier in SL • SL use 4x4 anti-aliasing, WPF uses 8x8 • SL uses a simplified line-breaking algorithm • SL generally has clipping off, WPF has it on • Default fonts and themes are different • SL has a simpler Property engine • SL has a web-focused (async) input system • SL doesn’t update IsMouseOver while animating • Various API signature differences • Bug differences
Planned Future Differences • Ribbon • Multi-touch • Win7 Shell Features
Summaryianel@microsoft.com • Silverlight and .NET Framework make a great platform for RIA’s and desktop apps • Silverlight is a subset of .NET Framework but “95%” the same for that subset • Reuse your skills and code between them • Learn once, apply everywhere
© 2008 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.