Tips and Tricks in a world of Mix

1. In VS2008 or VS2010 go to Tools –> Options

2. Expand Text Editor -> XAML -> Formatting –> Spacing






3. Under "Attribute Spacing" check "Position each attribute on separate line".

4. If you prefer, you can also put the first attribute on the same line as the tag by checking the box.  I use this setting because it isn’t offensive and still saves a little space.


Now, whenever you edit XAML in Visual Studio, press "Ctrl+K+D" and Visual Studio will reformat the XAML as desired.


if you check

Position first attribute on same line as start tag it’ll look like this :


I think that I preffer the second option.


Comments on: "Silverlight–Formatting Xaml – beautify" (1)

  1. Mykola said:

    Thank you for useful info!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: