Home > Microsoft .Net Development Tips > .NET Developer
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

.NET DEVELOPER

How to speed up Visual Studio 2008's slow WPF designer


Walt Ritscher, Contributor
05.12.2009
Rating: -3.50- (out of 5)


.NET Essentials Channel
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Most developers I know are obsessive about managing their software workspace. When you spend countless hours sitting at your laptop creating software, the last thing you want to do is wait on your tools. From setting up keyboard shortcuts to installing your favorite utilities, you know just how to squeeze every drop of performance from your tools so that you can write code fast and furious. WPF developers are no different. Here are a couple tips to speed up the WPF tools in Visual Studio.

Speeding up the designer

Visual Studio supports a plug-in designer model. The .NET Windows Forms designer is a great example of a designer plug-in: when you open a Windows Forms file in Visual Studio, the IDE determines that the Forms class has an affiliated custom UI designer. The designer is loaded into an IDE tab, your code is parsed and the designer renders your UI. Any changes you make to your form, like dragging a button from the ToolBox to the design surface, causes the designer to update the code in YourForm.designer.cs as well as forcing an update to the UI.

WPF UserControls, Pages and Windows designers work the same way. When you open a XAML file, Visual Studio finds the matching WPF designer and loads your XAML into it. If you use this WPF designer for more than few days, however, you'll begin to realize that it is slow, especially when loading large files.

This is a well-known problem, and the WPF designer team at Microsoft (codenamed Cider) is making good progress toward fixing the problem. In the meantime, they have added a setting that makes it easy to speed things up by disabling the designer's normal WYSIWY...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
.NET Developer
How to list fonts in WPF using markup extensions and data templates
How to convince management to buy Microsoft Visual Studio 2008
Microsoft webcast series previews new Visual Studio 2010 features
New features in Windows 7 bring new UI considerations for developers
User Account Control (UAC): How to develop code for standard users
Introduction to Vista's user account control (UAC) for developers
Visual Studio 2008 code metrics tools will help keep code clean
Downloadable MSDN library released for VS 2008 SP 1
Widgetbox provides good example of how to use Facebook Developer Toolkit
Microsoft previews new features in Visual Studio 2010

.NET Framework 3.5 and Visual Studio 2008 development
Microsoft's message at TechEd: make the most of what you have
How to list fonts in WPF using markup extensions and data templates
How to convince management to buy Microsoft Visual Studio 2008
Moonlight 1.0 release brings Silverlight to Linux
Microsoft cuts Visual Studio 2008 upgrade prices as VS 2010 looms
User Account Control (UAC): How to develop code for standard users
How to write installers in Vista that work correctly under UAC
How to elevate programs' privileges correctly using Vista's UAC
Introduction to Vista's user account control (UAC) for developers
Microsoft offers startups free development tools, MSDN subscription

Windows Presentation Foundation
How to develop applications targeting both Silverlight and WPF
How to list fonts in WPF using markup extensions and data templates
Fast guide: Silverlight blogs
Modeling tool provides 3D components for WPF apps
VantagePoint WPF Controls delivers rich suite of UI components
Mobiform releases WPF component set
ComponentOne adds rich-text editor to Studio Enterprise
Windows Developments: Product news, December 2007
Book Excerpt: What's new in Windows Presentation Foundation
What Visual Studio 2008 brings to client application development
Windows Presentation Foundation Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Cosmos  (SearchWinDevelopment.com)
IronRuby  (SearchWinDevelopment.com)
Visual Studio Express (VSE)  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


G view and using the XAML view instead.

  1. Open the 'Tools-Options' menu.
  2. Select the 'Text Editor-XAML-Miscellaneous' node.
  3. Check the 'Always open documents in full XAML' view checkbox.

[IMAGE]

Change the default XAML editor

The simplest change to make to speed up the loading of XAML files is to forget about using the WPF designer altogether. Instead, set the default editor for XAML files to the XML editor. You still get full IntelliSense support while editing XAML, but the load time for most files is dramatically reduced. Making this change is simple.

  1. Right-click a XAMLfile in the Solution Explorer.
  2. Choose the 'Open With…' menu item.
  3. Select the 'Source Code (Text) Editor' item and click the 'Set as Default' button.

[IMAGE]

[IMAGE]

The disadvantage with this approach is that you no longer see the XAML/Designer tabs in the editing window. If you do need to work with the designer, choose the 'View-Open With' menu item, and Visual Studio will open the file in another tab.

[IMAGE]

Walt has trained thousands of corporate developers during the last 14 years and he travels the world speaking at software conferences, and providing developer training for corporations. He writes for several IT magazines, and worked on books/videos and .NET courses for Microsoft Press. As a Wintellect consultant he is presently focused on the WPF, Surface and Silverlight APIs. Walt is also a Microsoft MVP, WPF Disciple, Silverlight Insider and author of the free Shazzam WPF Shader utility.


Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts