Iris Classon
Iris Classon - In Love with Code

Autoformatting XAML

As you probably already know if you follow me on Twitter- my bike got stolen last week and I was rather annoyed.

My new bike. Did a 30min ride today, got a 90 min ride planned tomorrow

I had decided to do my first triathlon, and had gotten in a good flow with biking, running and swimming on regular basis. I tried convincing myself that I should just skip it, drop the sport, but I saw a triathlon sprint I really want to do in a few months, so I went and bought a new racing hybrid today. Yes I know has nothing to do with autoformatting XAML, but the next bit has:

In case you are wondering if and how to auto format that lovely XAML in Visual Studio i can tell you we’ve had that integrated in VS since 2010 version,- it just seems rather well hidden!

Under Tools- Options - Text Editor - XAML - Formatting - Spacing select ‘Position each attribute on a separate line’

After that you can use Ctrl + E, D key shortcut to format the document, or select format manually from under File - Advanced - Format Document

Here is a before and after with the default template for Windows Store App- Hub Template

Before:

After:

Comments

Leave a comment below, or by email.
Marc
5/13/2014 9:56:49 AM
It's amazing how the simple things that can make all the difference can slip by unnoticed.  I am going to make sure these settings are on my machine - right now!  Thanks. :) 
AgeAgile Hobo
5/20/2014 8:52:38 AM
I blogged about another (better) way to autoformat XAML at http://blog.agilehobo.com/2014/05/autoformatting-xaml-hard-way_3410.html 
Iris Classon
5/30/2014 4:04:59 PM
Reply to: Marc
you are welcome :) 


Last modified on 2014-05-12

comments powered by Disqus