Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indentation - XAML

Does anybody know how to do an auto-indent a XAML file in Visual Studio 2010?

like image 564
Claudio Avatar asked Dec 01 '10 22:12

Claudio


3 Answers

With the document open, press

CONTROL+K CONTROL+D

like image 144
Raj More Avatar answered Oct 16 '22 17:10

Raj More


Menu - Edit:Advanced:Format Document (Your keyboard shortcut will be to the right of the menu item)

like image 35
Alex B Avatar answered Oct 16 '22 15:10

Alex B


I find that if I just close the current object using the auto-complete functionality Visual Studio will indent everything in-between.

So you could just delete the last line of your XAML and then just start retyping the start of the line, hit tab and get your XAML indented.

Or you could just select Edit > Advanced > Format Document.

like image 1
ChrisF Avatar answered Oct 16 '22 15:10

ChrisF