Search code examples
xmlvisual-studio-2010xamlpluginsalphabetical-sort

Visual Studio 2010 sort xml/xaml attributes


In Visual Studio 2010 is there an option or does anyone know of a plugin that will allow you to sort your xml/xaml attributes alphabetically?

I would like to be able to hit a hotkey and have this:

<Button
    Grid.Row="1"
    IsEnabled="True"
    IsDefault="True"
    ContentTemplate="{DynamicResource InsertButtonContentTemplate}"
    Click="_insertButton_Click"
    Content="Insert"
    HorizontalAlignment="Right"
    VerticalAlignment="Center"
    Grid.Column="1" />

alphabetize its attributes and turn into this:

<Button
    Click="_insertButton_Click"
    Content="Insert"
    ContentTemplate="{DynamicResource InsertButtonContentTemplate}"
    Grid.Column="1"
    Grid.Row="1"
    HorizontalAlignment="Right"
    IsEnabled="True"
    IsDefault="True"
    VerticalAlignment="Center" />

Solution

  • I found this Visual Studio 2010 plugin during my travels. It seems to do pretty much what I was looking for. (The plugin can be found at http://xamlstyler.codeplex.com/)