wpfxaml

Reordering XAML code?


example I got this line: notice how parameters how unordered

<Button  HorizontalAlignment="Center" Margin="200,150,0,0" Width="189" Content="Boo" 
Style="{DynamicResource btnGrayDownWIthcon}" IsDefault="True" IsCancel="False"
Background="{DynamicResource ContractApprovedGreen}"
Height="53" VerticalAlignment="Center" Name ="btnPoo" />

its a mess

Id like it to be:

<Button Name ="btnPoo" Content="Boo" 

Background="{DynamicResource ContractApprovedGreen}"
Style="{DynamicResource btnGrayDownWIthcon}" 

HorizontalAlignment="Center" VerticalAlignment="Center" 
Margin="200,150,0,0" 
Width="189" 
Height="53"

IsDefault="True" 
IsCancel="False"
    />

is there any automatic tool that can reorder xaml parameters by priorities and groups?


Solution

  • Yes, there is a Visual Studio extension called XAML Markup Styler which you can download and use for free from https://github.com/Xavalon/XamlStyler. My team and I have been using this for months and it works great. It does groups/priorities reordering too. :)