Q:

Make a grid to be closer to the top of the page - XAML

I have the following XAML:
<Grid    HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="0*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>

                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <PasswordBox HorizontalAlignment="Center" Grid.Row="0" Margin="12" Width="260" Height="32" PlaceholderText="Confirm Password"  BorderBrush="#FF755CB0" BorderThickness="1" Opacity="0.9" x:Name="ConfirmPassword"/>
            <Button Content="Sign-Up" HorizontalAlignment="Center" Margin="12" Grid.Row="1"  Width="260" Height="50" Background="#FF235085" BorderBrush="#FF6749AC" BorderThickness="1" Foreground="White" Opacity="0.9" RequestedTheme="Light" Click="Register_Click"/>
        </Grid>

Right now the grid is at the center of the screen, I wabt it to be a little bit higher, I can do it with margin, but I don't want any propery with pixel in my page. Is there any other wahy to do it?
Thanks.

A:

The easiest way to get your grid slightly above the centre without using Margins would be to put it in another Grid.
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition Height="1.2*"/>
    </Grid.RowDefinitions>
    <Grid HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Row="1" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="0*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <PasswordBox HorizontalAlignment="Center" Grid.Row="0" Margin="12" Width="260" Height="32" PlaceholderText="Confirm Password"  BorderBrush="#FF755CB0" BorderThickness="1" Opacity="0.9" x:Name="ConfirmPassword"/>
        <Button Content="Sign-Up" HorizontalAlignment="Center" Margin="12" Grid.Row="1"  Width="260" Height="50" Background="#FF235085" BorderBrush="#FF6749AC" BorderThickness="1" Foreground="White" Opacity="0.9" RequestedTheme="Light" Click="Register_Click"/>
    </Grid>
</Grid>

Note the second RowDefinition
<RowDefinition Height="1.2*"/>

This means the second row will take slightly more of the available space than the first row and you can adjust to meet your needs.

