How to speed up XAML editing in Visual Studio

The XAML UI Designer was giving me headaches with its lag and constant “Not responding” messages in Visual Studio Express 2012. Since I mostly work with the XAML source code directly, the trick was to turn off the designer by default and only switching to it when I need it.

The first step is to instruct Visual Studio to always open XAML files in full XAML view.

  • In Visual Studio go to Tools > Options
  • Navigate to Text Editor > XAML > Miscellaneous
  • Turn on “Always open documents in full XAML view”

That makes it a little better, but it still loads the designer in the background.

We can go one step further and change the default editor to source code only.

  • Right-click a XAML file and select “Open with…”
  • Select “Source Code (Text) Editor”
  • Click the “Set as Default” button and then “OK”

Opening XAML files is now much faster and you still get autocomplete.

If you want to view the file in the designer, just right-click it and choose “View Designer”. You will probably need to switch to design view afterwards.

Source

Nuno Freitas
Posted by Nuno Freitas on January 15, 2014

Related articles