May 122014
 
 May 12, 2014  Posted by at 1:12 pm Dev Environment, Dev Ops, Uncategorized, Universal Apps, WinRT, WP, WPF, XAML  Add comments

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

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!


2014-05-08_14-49-09

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

2014-05-08_14-50-14

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:

2014-05-12_13-45-33

After:

2014-05-12_13-46-27

  3 Responses to “Autoformatting XAML”

  1. 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. 🙂

  2. I blogged about another (better) way to autoformat XAML at http://blog.agilehobo.com/2014/05/autoformatting-xaml-hard-way_3410.html

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

What is 7 + 11 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)