Reorder actual xaml elements

Aug 24, 2012 at 9:18 AM

I don't know what would be involved with actually doing this but thought I would make mention of it:

Would it be viable to re-order the actual xaml elements based on their grid position?

I realise this may go beyond scope of this project of just styling xaml (as it would effect runtime behaviour). But I do find myself re-ordering elements within a grid control, sadly the designer does not adjust the xaml position of the controls meaning the tab navigation ends up a mess.

A simple example of this:

<Grid>
   
<Grid.RowDefinitions>
       
<RowDefinition Height="Auto" />
       
<RowDefinition Height="Auto" />
       
<RowDefinition Height="Auto" />
       
<RowDefinition Height="Auto" />
   
</Grid.RowDefinitions>
   
<TextBox Height="23" Name="textBox1" Width="120" />
   
<TextBox Grid.Row="2" Height="23" Name="textBox2" Width="120" />
   
<TextBox Grid.Row="1" Height="23" Name="textBox3" Width="120" />
   
<TextBox Grid.Row="3" Height="23" Name="textBox4" Width="120" />
</Grid>

The above will result in bizarre tab behaviour, however if the controls were simply ordered in the xaml in the same order their row values are the problem would go away.