tags:

views:

829

answers:

2

There is some way, a property like VerticalContentAlignment for aligning grid children or do I have to do it manually one by one?

+1  A: 

If most of the grid's children are of the same type you can use styles, for example putting this at the start of the grid will align all text boxes

<Grid>
    <Grid.Resources>
        <Style TargetType="TextBox">
            <Setter Property="HorizontalAlignment" Value="Right"/>
        </Style>
    </Grid.Resources>
 .
 .
 .

If you have only a few types of controls inside the grid this is very useful.

Nir
A: 

If TextAlignment works for you instead of HorizontalAlignment, it can be made even simpler:

<Grid TextBlock.TextAlignment="Right">
    <TextBox ....
....
Sergey Aldoukhov