如何在通用 Windows 平台应用程序中实施 <Grid>?

How to implement <Grid> in Universal Windows Platform App?

如何在 Windows 应用程序中使用 Gird

I want to create a Login form. I have used grid and used but the Rows are not aligned properly, How can I do that?

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="67*"/> <ColumnDefinition Width="293*"/> </Grid.ColumnDefinitions> <StackPanel> <TextBlock Text="Name" Height="32" Margin="0,0,0.333,0" ></TextBlock> <TextBlock Text="Last Name" Height="30" Margin="0,0,0.333,0" ></TextBlock> <TextBlock Text="Address"></TextBlock> </StackPanel> <StackPanel Grid.Column="1"> <TextBox></TextBox> <TextBox></TextBox> <TextBox></TextBox> </StackPanel> </Grid>

您应该在网格中定义行和列。

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="67*"/>
        <ColumnDefinition Width="293*"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="45"></RowDefinition>
        <RowDefinition Height="45"></RowDefinition>
        <RowDefinition Height="45"></RowDefinition>
    </Grid.RowDefinitions>
    <TextBlock Text="Name" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center"></TextBlock>
    <TextBlock Text="Last Name" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center"></TextBlock>
    <TextBlock Text="Address" Grid.Column="0" Grid.Row="2" VerticalAlignment="Center"></TextBlock>

    <TextBox Grid.Column="1" Grid.Row="0" Height="30"></TextBox>
    <TextBox Grid.Column="1" Grid.Row="1" Height="30"></TextBox>
    <TextBox Grid.Column="1" Grid.Row="2" Height="30"></TextBox>
</Grid>