Code4Blog (VS 2010)
Monday, May 31, 2010
Sunday, May 30, 2010
Follow Up. I discovered ReSharper can format XAML too. Details at the end.
Adding the two formatting commands to the XAML editor context menu makes reformatting easy and convenient.
First, setup VS’s XAML format per this blog post (found via stackoverflow). Then reformat all or just the selected XAML from the Edit | Advanced submenu:
Notice that the menu commands are Format Document and Format Selection. The word “Format” is first in both.
Adding these commands to the XAML editor context menu was more of a hassle than it should have been, IMO. I looked for “Format Document” and “Format Selection” without success in all the Categories in the Add Command dialog. I found the commands quickly using the searchable Options / Keyboard dialog box. Note they are “Edit.Format*”.