Code: Select all
<Grid HorizontalAlignment="Stretch" Background="White" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="7*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBox Text="Hello World!" Grid.Column="1" Height="30" Grid.Row="1"
x:Name="TextBlock1" HorizontalAlignment="Stretch" VerticalAlignment="Top"
TextAlignment="Center" VerticalContentAlignment="Center" />
</Grid>
So I have a grid with the above row definitions. This should force the textbox to be in the middle of the screen, but for some reason it appears in the bottom.
I know I could simply have one * row and set vertical center, but since I plan to have more rows and controls in the middle, I need this specific setup.
Thoughts on this?