如何在后面的代码中对齐控件。
XAML:
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="60" />
<RowDefinition />
</Grid.RowDefinitions>
</<Grid>
<TextBlock HorizontalAlignment="Center" Grid.row="0"/>
在后面的代码中,我想将DataGrid
in 添加到该网格中。
DataGrid dt = new DataGrid();
// how to add above the grid in to that
// layoutroot in second row.