问题
The hotkey Ctrl+E,Ctrl+D works for formatting C# code only, but not for XAML for some reason. Does anybody know what the hotkey is for it?
回答1:
Both Ctrl+E, D, and Ctrl+K, Ctrl+D work for me.
or Edit->Advanced->Format Document
回答2:
Just as user2425056 my XAML wasn't formatting with all three options from devdigital.
The option I had to set to get a proper formatting is: Tools >> Options >> Text Editor >> XAML >> Formatting >> Spacing >> and check “Position each attribute on a separate line”
回答3:
My Ctrl+E + D was not formating XAML until I went into Tools -> Options -> TextEditor -> XAML and made some changes. Then it started working!
来源:https://stackoverflow.com/questions/9453323/what-is-the-hotkey-for-formatting-xaml-in-vs2010