Why Buttons do not stretch to fill Grid cells?

Viewed 12096

I am about to create a Grid Matrix in a UWP application and came across this behavior where the Button control does not stretch to fill the available space; in contrast, the TextBox control does. How to force the Button control to behave like a TextBox?

     <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.Resources>
            <Style TargetType="Button">
                <Setter Property="BorderBrush" Value="Yellow" />
                <Setter Property="BorderThickness" Value="5" />
            </Style>

            <Style TargetType="TextBox">
                <Setter Property="BorderBrush" Value="Yellow" />
                <Setter Property="BorderThickness" Value="5" />
            </Style>
        </Grid.Resources>

        <TextBox   Grid.Row="0" Grid.Column="0" Text="One"   />
        <TextBox  Grid.Row="0"  Grid.Column="1" Text="Two"   />

        <Button   Grid.Row="1" Grid.Column="0" Content="Three"   />
        <Button  Grid.Row="1"  Grid.Column="1" Content="Four"   />
    </Grid>

enter image description here

1 Answers
Related