Wpf4 july2010


Published on

Published in: Technology
1 Comment
  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Wpf4 july2010

  1. 1. WPF 4<br />
  2. 2. Ted Hu ::tedhu@microsoft.com / twitter: @tedhu <br />Community Program Manager <br />Microsoft Windows Presentation Foundation<br />
  3. 3. Objectives<br />Give You A Concrete Understanding of WPF 4<br />New Features in WPF 4<br />Windows 7 light up<br />Tooling improvements<br />Tells You Which Features Can Also Be Used With .NET 3.5SP1 and How<br />3.5 SP1 is Preinstalled with Windows 7<br />Answer Questions (during Q&A)<br />3.5 SP1<br />
  4. 4. .NET 3.5 SP1Prior Art<br />Released on 11 August 2008<br />Number Of Bug Fixes And Improvements<br />Feature-packed Service Release<br />Performance. 15-45% performance improvements for key startup and runtime scenarios<br />Startup: Optimizing CLR NGEN layout, disk I/O, JIT code gen<br />Runtime: Graphics, data, text, to animation<br />Deployment. .NET 3.5 SP1 Client Profile, ClickOnce<br />Graphics. Extensible Shader Effects with HLSL support, Direct3D Interop<br />3.5 SP1<br />More @ http://windowsclient.net/wpf/wpf35/wpf-whats-new-35sp1.aspx<br />
  5. 5. History<br /><ul><li>Released 4 major versions of WPF and 4 major versions of Silverlight
  6. 6. Common set of tools (VS, Blend), and programming model (XAML, .NET)
  7. 7. Redefined RDA and RIA programming</li></li></ul><li>WPF 4 - Lots of Good Stuff<br /><ul><li>Client Profile
  8. 8. Data controls
  9. 9. Accessibility Improvements
  10. 10. Chart Controls
  11. 11. Control Themes
  12. 12. Hundreds of good bug fixes…
  13. 13. Plus all the goodness of .NET 4!
  14. 14. Dynamic Language Support
  15. 15. MEF
  16. 16. Globalization and NLS improvements
  17. 17. Managed / Native Code interop</li></ul>More…<br /><ul><li>XAML
  18. 18. Cached compositions
  19. 19. Text clarity
  20. 20. Layout Rounding
  21. 21. ClickOnce improvements
  22. 22. Multitouch
  23. 23. Win7 Taskbar
  24. 24. Win7 Ribbon
  25. 25. Focus mgt improvements
  26. 26. Support for UIAccessible2
  27. 27. VSM integration
  28. 28. Full Trust XBaps
  29. 29. Pixel Shader 3</li></ul>Scott Guthrie’s WPF 4 blog post <br />http://weblogs.asp.net/scottgu/archive/2009/10/26/wpf-4-vs-2010-and-net-4-0-series.aspx<br />
  30. 30. WPF 4<br />Windows 7<br />Taskbar Integration <br />Multitouch<br />Improved Fundamentals<br />Graphics: Cache Composition, Pixel Shader 3<br />New Text Rendering Stack<br />Layout Rounding<br />Deployment Streamlined : Client Profile, ClickOnce<br />Enabled Visual Studio’s UI and Editor<br />Better Tooling<br />
  31. 31. WPF for Windows 7 Rapid Application Development on Win7 Innovations<br />Multi-Touch<br />Taskbar<br />DirectWrite for Text Rendering<br />Control Toolkit (Ribbon, etc.)<br />Common Dialogs<br />File Explorer Presence and Customization<br />More…<br />Use with .NET or via XAML in WPF<br />
  32. 32. WPF Taskbar Integration<br />Thumbnails toolbars <br />Icon overlays <br />Progress bars <br />Jumplists<br />With XAML Support<br />3.5 SP1<br />
  33. 33. <Application x:Class="Fishbowl.App"><br /><JumpList.JumpList><br /><JumpListShowRecentCategory="True"><br /><JumpTask<br /> Title="Slideshow"<br /> Arguments="/Slideshow" /><br /><JumpTask<br /> Title="Latest News"<br /> Arguments="/Newsfeed" /><br /><JumpTask<br /> Title="Sync Now"<br /> Arguments="/Synchronize" /><br /></JumpList><br /></JumpList.JumpList><br /></Application><br />3.5 SP1<br />
  34. 34. WPF 4 Multitouch<br />UIElement changes<br />Manipulation Events (tracking and interpreter)<br />Touch System Gesture events (double-tap, rollover)<br />Raw Touch Input Events (for going to the metal)<br />Multi-touch support in controls<br />ScrollViewer Update to accept pan gestures<br />Base Controls Updated to be multi-touch aware<br />Multi-capture Support for more than one contact point at time<br />New Multi-touch Controls e.g. ScatterView<br />Compatible with Surface SDK 2.0<br />
  35. 35. Touch Development Roadmap<br />Windows 7 Release<br />NET 4 / Surface 2.0 Release<br />Native<br />Win32<br />Application<br />WinFormsApplication<br />WPF Application<br />Surface Application<br />Surface SDK<br />1.0<br />Surface SDK 2.0<br />Multi-Touch Controls<br />Surface <br />Multi-Touch Controls & API<br />Multi-Touch API<br />WPF 3.5 SP1<br />WPF 4<br />WPF 3.5<br />Managed Wrapper and Interop<br />Managed Wrapper and Interop<br />Multi-Touch API and Controls<br />Surface Hardware<br />Windows 7<br />Surface Hardware<br />Windows Vista<br />Windows 7<br />Multi-Touch API<br />
  36. 36. Microsoft Pivot<br />Seesmic Look<br />Available now at http://fishbowlclient.com<br />Multitouch<br />Taskbar <br />demo <br />
  37. 37. WPF 3.5 SP1 Multi-Touch Support<br />Enabling Multi-touch Input<br />Multi-touch Input via Stylus events<br />Implementing Multiple Capture<br />Using Win7 Manipulation and Inertia Processors<br />Windows Multitouch Sample .NET Interop Library http://code.msdn.microsoft.com/WindowsTouch<br />3.5 SP1<br />14<br />
  38. 38. Windows API Code Pack for .NET<br />Vista and Windows 7<br />Restart and Recovery<br />Transactions<br />Search<br />Network and power aware<br />Windows 7<br />Sensor Platform<br />Federated Search<br />Controlling any related services<br />More… <br />3.5 SP1<br />
  39. 39. FundamentalsA Quality-First Release<br />Framework Deployment<br />Application Deployment<br />Text Clarity<br />Layout Rounding / Snapping<br />Graphics Performance<br />Improved Interop<br />UIAutomation – For accessibility and VS Test Tools<br />
  40. 40. Framework Deployment<br />.NET 4 is a Side by Side release!<br />Visual Studio 2010 supports multi-targeting (e.g. Silverlight + WPF v3 and 4)<br />Client Profile SKU & Setup Improvements<br />
  41. 41. Client Profile SKU<br />Smaller, Faster NET Framework SKU<br />.NET Framework Client: 28mb<br />Setup optimizations for ngen, download, etc.<br />Works across ALL CONFIGURATIONS<br />Brandable deployment experience<br />Developers can customize app deployment experience to match brand<br />Can integrate framework and app installers<br />Tools and documentation for creating these packages<br />Easier application deployment<br />Developers may use deployment bootstrapper to manage the installation of their app and pre-reqs<br />Will install application after the framework and launch it (.msi, .application or .xbap)<br />3.5 SP1<br />
  42. 42. Setup and Size<br />.NET 4 Client Profile is the default target in almost all VS 2010 Client Project Templates (WinForms, WPF, VSTO)<br />Supported on all OS that Full .NET is<br />.NET 4 Full & Client offer big improvements<br />75%+ size reduction over earlier versions<br />48 MB Full (x86/x64); 28 MB Client (x86)<br />Both Full and Client Support x86 & x64<br />Size on media <br />combined x86/x64 package<br />
  43. 43. Setup and Client Profile <br />.NET 4 Full & Client Profile Size & Deployment Perf<br />Client x86=~28MB, Client x86/x64=~41MB (similar size to x86 3.5SP1 Client Profile with lots more features )<br />Full x86=~35MB , Full x86/x64=~48MB (from ~240MB in 3.5Sp1 )<br />Client Profile is a First-Class Citizen<br />Client Profile Is The De Facto Framework that will be available on Windows Update for desktop PCs<br />Can Be Serviced Independently (of Full Framework) as Standalone & serviceable package (does not require Full Framework)<br />Supported by Visual Studio 2010 in all respects (e.g. targeting, deployment project, etc).<br />
  44. 44. Available now at http://photosuru.com<br />Client Profile<br />demo <br />
  45. 45. What is ClickOnce?<br />Technology to help deploy, version and update rich clients<br />Supports automatic detection and deployment of application updates<br />Provides bootstrapping capabilities<br />Applications execute in a secure sandbox with support for safe permission elevation <br />
  46. 46. ClickOnce Deployment<br />Originally released with .NET Framework 2.0 <br />.NET Framework 3.5<br />Can move deployment locations<br />Can support third-party publishing and branding<br />Manifest Generating and Editing Tool improved<br />.NET Framework 3.5 SP1<br />Can publish unsigned applications<br />Better FireFox support<br />Design-time file associations<br />
  47. 47. ClickOnce Deployment<br />Continuing Improvements For ClickOnce to enable more seamless app install & update<br />Command-line arguments for CO-deployed apps<br />File associations for CO deployed apps<br />Background auto-updates and custom install User Experience<br />3.5 SP1<br />
  48. 48. The ClickOnce Experience<br />Web Server<br />
  49. 49. Deploying Using ClickOnceOnline-Only Update Scenario<br />Publish.htm<br />Client Workstation<br />MyApp<br />MyApp V1 <br />Domain<br />Publish.htm<br />MyApp.application<br />MyApp_1.0.0.0<br />HTTP<br />MyApp_1.1.0.0<br />Check manifest<br />for updates<br /><br />MyApp.exe.manifest<br />Download updates<br />Web Server<br />
  50. 50. ClickOnce Background Update<br />demo <br />
  51. 51. Problems Solved by ClickOnce<br />Choice of web, UNC or CD installation<br />On demand feature deployment<br />Automatic application updates<br />Support for application rollback<br />Removal of version conflicts<br />…<br />Administrators can control how applications are granted permissions, safe elevation<br />
  52. 52. (Pre-4) WPF Text Rendering<br />
  53. 53. WPF 4 <left> vs. GDI <right><br />
  54. 54. Text in WPF 4 <br />APIs In a Nutshell<br /> <Page<br />...<br /><StackPanel<br /> TextOptions.TextRenderingMode="ClearType"<br /> TextOptions.TextFormattingMode="Display">  <br /> <br /><TextBlock Text="This will use Display mode formatting and render with ClearType"/><br /> </StackPanel>  <br /> </Page><br />
  55. 55. Text APIs<br />TextFormattingMode<br />Ideal.Maintains high fidelity with their outlines from the font file (default behavior which uses IdealWidth text metrics)<br />Display.Glyph has width of multiple whole pixels and is positioned on whole pixels (optional new behavior which uses CompatibleWidthtext metrics)<br />When To Use Ideal Mode<br />Large Text – As text size increases, Ideal clarity issues dissipate. After ~15pt, Ideal mode is as clear & better spaced than display mode text<br />Transformed Text – If transform is applied to text, Ideal mode should be used. Ideal mode text is designed to be drawn anywhere<br />Zoomed Text – Zooming text is a special case of transformed text. Zoomed text should be implemented by increasing the text size<br />When To Use Display Mode<br />Small Text – Smaller WPF text (<~15pt) can appear more blurry. If so, switching to display mode should help<br />
  56. 56. Text APIs<br />TextRenderingMode<br />Aliased (aliased rendering)<br />Grayscale (grayscale antialiasing)<br />ClearType (ClearType always on)<br />Auto (ClearType unless otherwise specified in the system font smoothing options)<br />Comparison of ClearType ,Grayscale, Aliased text using Display TextFormattingMode<br />
  57. 57. Text Improvements<br />demo <br />
  58. 58. Layout Rounding<br />WPF Uses DPI-independent Graphics System<br />Objects Fall “Between Pixels”<br />Side Effects: Rendering Artifacts<br />Anti-aliased blurriness<br />Semi-transparent edges<br />Layout Rounding<br />Non-integer Pixel Values Are Rounded To Whole Numbers during Measureand Arrange<br />UseLayoutRounding.Rounds an object’s coordinates on whole pixels <br />
  59. 59. Layout Rounding<br />demo <br />
  60. 60. Graphics<br />Composition API – give application authors fine grained control over caching rendered elements in video memory<br />An input to a shader effect<br />A brush to fill any arbitrary 2D shape<br />A texture on a 3D model <br />Text Rendering – New and Improved (on all Windows versions)<br />Pixel Shader 3 Support <br />256  65,000 instructions<br />Extends 3.5 SP1’s ShaderEffect with PS 3 support<br />Tools like Shazzam edit and test Pixel Shader Effects<br />http://www.shazzam-tool.com<br />
  61. 61. Cached Composition<br />BitmapCacheenable caching of entire or partial visual tree<br />Avoids Re-rendering Costs per-frame <br />Significant Performance improvements possible <br />Fully Interactive. Remains responsive to user input<br />Respects Dirty Regions and invalidates accordingly<br />Fine-grain control for quality of Cached visual<br />RenderAtScale. Fine-grain knob to set trade-off between re-rendering costs vs. quality, e.g. Processor/memory ++  1, 2, 20X…n scale <br />
  62. 62. Cached Compositions<br />demo <br />
  63. 63. Cached Composition Usage<br />UIElement.CacheMode = new BitmapCache();<br /> <br /><RectangleCacheMode="BitmapCache"/><br /><Rectangle><br /><Rectangle.CacheMode><br /><BitmapCache EnableClearType="true"RenderAtScale="4"SnapsToDevicePixel="true"/><br /></Rectangle.CacheMode><br /> </Rectangle><br />
  64. 64. Easing Functions for Animations<br />Basic discrete, linear, spline animations<br />A Dozen Easing Functions for creating fluid animated behaviors <br />Built-in (circular, exponential, elastic, and bouncy animation progress) andExtensible(custom easing functions) Behaviors!<br />
  65. 65. Easing Functions for Animations<br />demo <br />
  66. 66. WPF Tooling Improvements<br />Visual Studio Designer<br />Expression Blend 3<br /><ul><li>RAD Databinding
  67. 67. Easier Auto Layout
  68. 68. Markup Extension IntelliSense
  69. 69. More/Easier Prop. Editors
  70. 70. Easier App Styling
  71. 71. Silverlight Just Works
  72. 72. Less XAML Editing
  73. 73. Improvements to XAML authoring and workflow
  74. 74. VSM
  75. 75. XAML IntelliSense
  76. 76. Behaviors
  77. 77. Transition Animations
  78. 78. Prototyping Tools</li></li></ul><li>Large Scale WPF Apps @ Microsoft: Visual Studio 2010 + WPF 4<br />Editor<br />UI<br />Why and how Microsoft Visual Studio 2010 was built with WPF 4<br />- http://microsoftpdc.com/Sessions/CL09 - http://tinyurl.com/yeazt9b <br />Expression Web<br />Expression Blend<br />
  79. 79. WPF Apps @ Microsoft<br />Expression Design and Encoder <br />Deep Zoom Composer<br />Enterprise Library 5.0<br />Semblio<br />Microsoft Pivot<br />SQL StreamInsight Debugger<br />Microsoft Surface<br />PowerShell ISE<br />Microsoft Test & Lab Manager (for VSTS)<br />Active Directory Administrative Center<br />
  80. 80. #Feedback: Performance!<br />#VS2010add reference dialog is much faster! Can I get a AMEN?<br />The developers on the Visual Studio 2010 RC must have had their usual beverages replaced with unicorn tears or something<br />VS2010 RC is fast, I wonder what happens when they hit RTM, it'll be like a cheetah, should be called VS Cheetah!!!<br />Just tried VS2010 RC. One word incredible. Super fast, great build with things I saw in earlier releases fixed. So awesome. <br />#vs2010 is fast like ambulances flying through a school zone at 120 mph being chased by ninjas. and the ninjas are on fire!<br />VS 2010 RC performance is ridiculously faster, can't wait to switch over full time!<br />
  81. 81. More #Feedback<br />“Definitely a MASSIVE improvement since VS2010Beta2… So much better than the beta2 that it's hard to know where to start… GREAT WORK GUYS.” <br />“This release works much faster and is more responsive than VS 2008.” <br />“I was concerned about the time that particularly xaml files were taking to load - this is now way better.” <br />“My impression of XAML editor performance seemed better – particularly in the designer.” <br />“I’ve used the latest build over RDP and on my tablet, and I am very happy with the state of VS2010.” <br />“Involving partners and [the] community to take feedback is a good strategy!” <br />“Add References was fast!  :)<br />“IntelliSense seems to be faster/snappier than VS2008 – great job!”<br />
  82. 82. More #Feedback<br />@DanWahlin: The performance improvements with Visual Studio 2010 RC compared to previous builds are huge. Really happy with what I'm seeing so far. <br />@peterbromberg: VS2010 RC: I must admit, I am impressed. Major speed and performance improvements. They are obvious immediately! <br />@Nick_Craver: RCperformance is ridiculously faster, can't wait to switch over full time! <br />@Rlz2cool: Just tried VS2010 RC. One word incredible. Super fast, great build with things I saw in earlier releases fixed. So awesome. <br />@ddotterer: Trying out VS2010 RC: Snappier UI, much faster IntelliSense, significant build time reduction, etc. Overall: AWESOME JOB <br />@tomkirbygreen: Oh my goodness, VS2010 RC is much, much faster. Kudos to the VS perf team and everyone else. Uninstalling Visual Studio 2008 :-)<br />
  83. 83. WPF 4 Improvements for VS 2010<br />Text Stack<br />WPF 4 Now Use DirectWrite for much improved text clarity<br />WPF 4 English Text is faster (~10%) compare to WPF 3.5 SP1<br />Improved JPN MS Gothic Font perf (the VS10 JPN default) <br />UIAutomation Improvements significantly improve Visual Studio performance on tablets and touch-enabled PCs<br />Graphics<br />New API To Allow Editor Line-scroll to be significantly more efficient over RDP and update less area. <br />Improve Reliability On VMs. Added API to allow WPF apps to force SW rendering per process enabling Visual Studio 2010 to use SW rendering<br />
  84. 84. WPF 4 Improvements for VS 2010<br />XAML<br />WPF Designer Template Parsing now ~2x faster <br />MEF VS & Editor Extensions use XAML catalog for better perf<br />WPF Designer and Blend share same XamlDom -> ObjectGraph code<br />MSBuild Uses XAMLto parse build properties files<br />Tree Services<br />Improved Focus Management<br />ExclusiveMenuMode enable better management of keyboard focus between WPF and interop components in MenuMode<br />RestoreFocusMode allow VS full control over focus restoration amongst interop components<br />Performance: Use cached copy of DispatcherSynchronizationContextto improve Editor Scroll scenarios (~25%+ gain)<br />
  85. 85. Controls<br />Now in WPF 4<br />DataGrid, DatePicker<br />VSM<br />Controls Toolkit<br />Chart Controls<br />Themes<br />Ribbon<br />More coming after RTM…<br />More at http://wpf.codeplex.com<br />3.5 SP1<br />
  86. 86. Related Resources <br /><ul><li>Please submit session feedback – we read every one
  87. 87. Vote: Let your voice be heard on WPF futures/features</li></ul>http://dotnet.uservoice.com/forums/40583-wpf-feature-suggestions<br /><ul><li>Read Scott Guthrie’s blog post on WPF 4</li></ul>http://weblogs.asp.net/scottgu/archive/2009/10/26/wpf-4-vs-2010-and-net-4-0-series.aspx<br /><ul><li>Series of short “how-to” videos introducing What’s New in Windows Presentation Foundation 4</li></ul>http://www.msdev.com/Directory/SeriesDescription.aspx?CourseId=147<br /><ul><li>Take advantage of crisp text and layout rounding</li></ul>http://blogs.msdn.com/text/<br /><ul><li>Deploy WPF apps faster with .NET 4 Client Profile</li></ul>http://blogs.msdn.com/jgoldb/archive/2009/05/27/net-framework-4-client-profile-introduction.aspx<br />
  88. 88. THANK YOU<br />WPF 4 <br />tedhu@microsoft.com<br />
  89. 89. © 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.<br />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.<br />