ASP.NET Hosting

Life changing XAML tip for Visual Studio

If you've worked with XAML in Visual Studio 2008 (SP1), either for WPF or Silverlight work, you know how painful it is.

Of course, the first thing to do is to get rid of the design view. It's slow as a snail and it's pretty useless anyway.
Make yourself a favor, and check "Always open documents in full XAML view" in "Tools | Options | Text Editor | XAML | Miscellaneous".

Even if this a great improvement, you'll soon realize that Visual Studio still sucks up a lot of your time and energy when you switch to a XAML file in the text editor. The same happens when you switch back to Visual Studio from another application. Now, try to open two XAML files side-by-side and the time to display them doubles. Same thing when you switch between two XAML files.

What the heck, there's gotta be a solution to this damnation! How could we develop good WPF or Silverlight applications if this XAML editor keeps getting on our nerves?
I've been enduring this for a long time. I had tried to edit the XAML file as an XML file, but this disabled IntelliSense, for some reason. So the XML editor was not an option.

Microsoft doesn't seem to be in a hurry to provide a fix... Luckily, today I found an unexpected solution: use the "Source Code (Text) Editor". It doesn't seem obvious based on its name, but this editor provides XAML IntelliSense, XML collapsing, and the XAML context menu.
To use this, it's quite simple:

  1. Right-click on a XAML file in the Solution Explorer
  2. Select "Open With..."
  3. Select "Source Code (Text) Editor"
  4. Click on "Set as Default"
  5. Click OK
  6. You're done!

The cherry on the cake: If you want to use the default XAML editor (with its split view, navigator, etc.), you just have to select "View Designer" in the text editor's context menu or use SHIFT+F7.

Enjoy your newly gained life!

Update: If you experience crashes when editing XAML files, this hot fix may help.

49 Comments

Comments have been disabled for this content.