views:

335

answers:

1

I am writing my UI mostly in XAML without a wysiwyg

in grids you can do

  <textbox  Grid.Column="0" Grid.Row="0" ...

when creating a grid comming from a html background i have been doing ...

<textbox  Grid.Column="0" Grid.Row="0">
<Label Grid.Column="1" Grid.Row="0">

<textbox  Grid.Column="0" Grid.Row="1">
<Label Grid.Column="1" Grid.Row="1">

but ordering the XAML by columns just seems neater.

<textbox  Grid.Column="0" Grid.Row="0">
<textbox  Grid.Column="0" Grid.Row="1">

<Label Grid.Column="1" Grid.Row="0">
<Label Grid.Column="1" Grid.Row="1">

seems neater.

just curious how everyone else is doing it.

A: 

That depends on weather or not you want controls to be on top of each other, that's the only significant difference when re-ordering them like that.

In XAML Controls are ordered ( the z-index ) as you add them, meaning that if you first add <textbox> and then <label>, the <label> can be on-top of the <textbox> and not the other way around.

However in your case, it is Much nicer to add them ordered by row then column then z-index.

That's the way I would do it.

Filip Ekberg