WPF如何将按钮放入列内的行中

WPF How to put button into row which is inside column

如何将按钮放入列内的行中?

   <Grid.ColumnDefinitions>
        <ColumnDefinition Width="200" />
        <ColumnDefinition MinWidth="300" Width="*" />
    </Grid.ColumnDefinitions>
    <Grid Grid.Column="1">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition MaxHeight="50" MinHeight="50"/>
        </Grid.RowDefinitions>
    </Grid>

Grid.Row="2" 超出索引。 Grid.Colum="1" 将按钮放入正确的列中。使用这些行的正确方法可能是什么?

您最初猜测的行索引是正确的。您只需要将按钮放在 XAML.

中的适当位置即可
<Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="200" />
    <ColumnDefinition MinWidth="300" Width="*" />
  </Grid.ColumnDefinitions>
  <Grid Grid.Column="1">
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="*"/>
        <RowDefinition MaxHeight="50" MinHeight="50"/>
    </Grid.RowDefinitions>
    <Button Grid.Row="2"/>
  </Grid>
</Grid>