1 / 36

How Microsoft Visual Studio 2010 Was Built with WPF 4

CL09. How Microsoft Visual Studio 2010 Was Built with WPF 4. Paul Harrington Principal Software Engineer Microsoft Corporation. Why, What, How, Who?. Why WPF? What WPF features are used? How was it built? Who was involved?. Why WPF?. Technological Prove the capabilities of WPF 4.0.

marcel
Download Presentation

How Microsoft Visual Studio 2010 Was Built with WPF 4

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. CL09 How Microsoft Visual Studio 2010 Was Built with WPF 4 Paul Harrington Principal Software Engineer Microsoft Corporation

  2. Why, What, How, Who? • Why WPF? • What WPF features are used? • How was it built? • Who was involved?

  3. Why WPF? • Technological • Prove the capabilities of WPF 4.0

  4. The Visual Studio 2010 IDE demo Paul Harrington Principal Software Engineer Visual Studio Platform Team

  5. Why WPF? • Technological • Prove the capabilities of WPF 4.0 • Architectural • Separated Presentation • Support for long range road map • Key VS 2010 features need it • Editor, Architecture editor, Parallel tools… • We took the “pain” so you don’t have to

  6. What WPF Features are used? • Declarative UI using XAML • Data binding • Managed and native data models • Style templates • Application Resources • Interop with Win32 • Integration with the message loop • New text stack based on DirectWrite

  7. Staged Approach • Define the data models • Replace the main window with WPF • Write new • Window Manager, Command Bar presentation • Hidden behind switches, off by default • Scout with selected teams • Test, test, test • Reverse the switches • Leave old presentation for regression testing • Remove old code

  8. A lesson learned: Test conversion costs • We underestimated the cost of rewriting test cases • Too many HWND assumptions • Many different testing frameworks • But there were opportunities • Unify test frameworks • UI Automation accessibility framework • Test at the data layer

  9. What were the challenges? • Mixed mode application • Native and Managed code • WPF and HWNDs (Win32 and WinForms) • Keep existing extensions working • Allow new extensions to take advantage of WPF • Don’t “stop the train” • Text Clarity • Performance

  10. Challenges of a Mixed-Mode App • Interop in the data layer • Managed code binding to native models • Interop in the presentation layer • Composition of new and old • Focus and activation • Integration with the message loop

  11. Composition of new and old • interfaceIVsWindowPane : IUnknown • { • HRESULT SetSite ([in] IServiceProvider *pSP); • HRESULT CreatePaneWindow([in] HWND hwndParent, • [in] int x, [in] int y, • [in] intcx, [in] int cy, • [out] HWND *hwnd); • HRESULT GetDefaultSize([out] SIZE *psize); • HRESULT ClosePane(void); • HRESULT LoadViewState([in] IStream *pstream); • HRESULT SaveViewState([in] IStream *pstream); • HRESULT TranslateAccelerator(LPMSG lpmsg); • }

  12. Presentation-neutral interfaces • interfaceIVsUIElementPane : IUnknown • { • HRESULT SetUIElementSite([in] IServiceProvider *pSP); • HRESULT CreatePane([out] IUnknown **ppunkUIElement); • HRESULT GetDefaultUIElementSize([out] SIZE *psize); • HRESULT CloseUIElementPane(void); • HRESULT LoadUIElementState([in] IStream *pstream); • HRESULT SaveUIElementState([in] IStream *pstream); • HRESULT TranslateUIElementAccelerator(MSG *lpmsg); • }

  13. Integrating with the Message Loop and Focus Handling demo Paul Harrington Principal Software Engineer Visual Studio Platform Team

  14. Integrating with the Message Loop • ComponentDispatcher • RaiseThreadMessage method • Managing Focus • HwndSource.DefaultAcquireHwndFocusInMenuMode • Use WindowsFormsHost • Menu mode • InputManager.Push/PopMenuMode methods • Listen to PreviewGotKeyboardFocus

  15. Text and Image Clarity • “Fuzzy” images • UseLayoutRounding = "True" • “Blurry” text • TextFormattingMode = "Display"

  16. DirectWrite demo Paul Harrington Principal Software Engineer Visual Studio Platform Team

  17. Performance • Startup • Atomic operations on the Visual Tree • Memory usage • VMMap • SOS.dll, !dumpheap –stat • Windows Performance Analyzer (xperf) • Hardware versus Software rendering • Virtual machines and Remote Desktop • Scrolling in the Editor

  18. Scrolling Performance • Visual.VisualScrollableAreaClip • Hint to software renderer to use scrolling • Best with • UseLayoutRounding="True"

  19. Who? • Core team of about 12 people • 7 developers • 5 testers • WPF Team • Expression Suite Team

  20. WPF Sessions @ PDC09 • PDC09-CL09How Microsoft Visual Studio 2010 Was Built with Windows Presentation Foundation 4 TUE 11/17/2009, 11:00AM - 12:00PM, Room 502A • PDC09-CL11Advanced Windows Presentation Foundation Application Performance Tuning and Analysis TUE 11/17/2009, 4:30PM - 5:30PM, Room Petree Hall D) • CHALK TALK Deep Dive into WPF4 Multi-Touch APIs WED 11/18/2009 11:00PM - 12:00PM, The Big Room • PDC09-CL31 Mastering WPF Graphics and Beyond WED 11/18/2009, 12:30-1:15PM, Room Hall E - 151 • PDC09-CL10Windows Presentation Foundation 4 Plumbing and Internals THUR 11/19/2009, 10:00AM - 11:00AM, Room Hall E – 151 • PDC09-CL27Multi-Touch on Microsoft Surface and Windows 7 for .NET Developers THUR 11/19/2009 , 11:30AM - 12:30PM, Room Petree Hall C • PDC09-CL24XAML Futures in Microsoft .NET Framework, Microsoft Silverlight and Tools, THUR 11/19/2009 , 1:45PM - 2:45PM, Room Hall F - 153 • MORE WPF 4 @ WPF Community sitehttp://connect.microsoft.com/wpf

  21. Resources • Snoop http://www.blois.us/Snoop/ • Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 • After download, run “Install Windows Performance Toolkit”. Installs: • Windows Performance Analyzer (XPerf) • WPF Performance Suite (VisualProfiler, Perforator) • VMMap.exe live.sysinternals.com • XamlPad is in the Windows 6.0A SDK • Use a XamlPad.exe.config to run on WPF 4.0

  22. Q&A

  23. YOUR FEEDBACK IS IMPORTANT TO US! Please fill out session evaluation forms online at MicrosoftPDC.com

  24. Learn More On Channel 9 • Expand your PDC experience through Channel 9 • Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses channel9.msdn.com/learn Built by Developers for Developers….

  25. Appendix

  26. DirectWrite formatting and rendering modes • TextOptions.TextFormattingMode= • "Ideal" • "Display" • TextOptions.TextRenderingMode= • "Auto" • "Aliased" • "Grayscale" • "ClearType"

  27. TextFormattingMode“Ideal”

  28. TextFormattingMode “Display”

  29. TextFormattingMode comparison

  30. DirectWrite • Ideal • Display

  31. Display Ideal

  32. Running XamlPad on WPF 4.0 • Create a file called XamlPad.exe.config with the following contents. Save it alongside XamlPad.exe. • <?xmlversion ="1.0"?> • <configuration> •   <startup> •     <requiredRuntimeversion="v4.0" /> •   </startup> • </configuration>

More Related