Tactile XAML editing with ReSharper
Working with XAML files in Visual Studio can quickly become a pain on medium to large projects. Even with a decent machine. loading and editing XAML documents can feel very sluggish. There are several things that can be done to make the overall experience better.
If you’re never using the visual WPF designer, canada goose branta livigno parka store online . make sure it never loads. I’m not simply talking about enabling the option “Always open XAML documents in full view” here. Even if that helps by reducing document opening times a bit. some designer components are still loaded. and there is still room for improvement, real canada goose vancouver broadway . The simplest way to never load the designer is to right click on any XAML document in the solution explorer. choose “Open with”. select “Source Code (Text) Editor” and click on “Set as default”. There won’t be XAML/Design tabs anymore in the editor and your documents should open fast discount canada goose store locator new york store .
Now that your documents are loading fast. you may want to edit them fast as well canada goose store locator new york store . In certain cases. the built-in IntelliSense for XAML is just slow. and happens to run on the main thread. making the overall typing experience quite bad. You can see below a dotTrace performance snapshot of five characters being typed inside a x.Type markup element canada goose store locator new york store online . which is where I usually experience extreme sluggishness.
More than two seconds for the five keystrokes are being spent on completing the current statement. Even considering the overhead added by the profiler. that’s still not a smooth experience since this function runs on the main UI thread. What can we do then canada goose store locator new york store . Turn off auto-completion. Don’t worry, discount canada goose yukon bomber sale . we’re going to replace it soon discount canada goose store locator new york store .
If you ever wandered into Visual Studio completion options for various languages canada goose store locator new york store . you may have noticed that the checkbox “Auto list members” is disabled for XAML and thus cannot be unchecked. There are registry solutions to disable it. as seen on this Stack Overflow post canada goose store locator new york store on sale . However. as strange as it may seem. the call stack is still the same and the slow performance doesn’t disappear even with the auto listing disabled canada goose parka uk sales .
In Visual Studio 2010. IntelliSense appears to still be working. even if no completion list is shown engelhorn canada goose chateau online store . We have to turn it off at the core. Close all Visual Studio instances. then open the registry at HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VisualStudio\10. 0\Languages\Language Services\XAML (don’t forget to remove Wow6432 if you’re not using a 64 bit OS) and change the dword value CodeSense from 1 to 0. You can also use the reg files provided at the bottom of this post to quickly enable or disable XAML IntelliSense in Visual Studio 2010. Be aware that this modification is done at the machine level canada goose femme lille outlet online . and will impact all local users.
In Visual Studio 2012. following the instructions on the Stack Overflow post seems to suffice to disable built-in IntelliSense.
Open Visual Studio. XAML editing should now be fast. But fast without any auto-completion is pretty meaningless canada goose women s expedition parka store . That’s where ReSharper kicks in. In version 6 and the newly released version 7. it provides advanced XAML completion. including data context completion in bindings and other niceties. The downside of this is that it’s currently shown only on demand by using Ctrl+Space. That’s partly why I developed GammaXaml. a ReSharper plugin that improves XAML editing in general canada goose store locator new york store . and exposes ReSharper on demand completion as automatic. on typing completion. Simply install the plugin and you’re done. You can now enjoy a pretty fluid editing experience.
Attachment. ChangeXamlIntelliSense. zip.