If I make a grid with two rows and two columns all set to "1*" I would expect that the result would be 4 equal sized cells (and in fact that is exactly what the designer shows).
Here is my code:
Code: Select all
<Page
x:Class="CSHTML_9_1_Test.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CSHTML_9_1_Test"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid x:Name="mainGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.Row="0" Background="Yellow">
<TextBlock Text="Location 0,0" Padding="15,15,15,15"/>
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="0" Background="LightGreen">
<TextBlock Text="Location 1,0" Padding="15,15,15,15"/>
</StackPanel>
<StackPanel Grid.Column="0" Grid.Row="1" Background="LightBlue">
<TextBlock Text="Location 0,1" Padding="15,15,15,15"/>
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="1" Background="Pink">
<TextBlock Text="Location 1,1" Padding="15,15,15,15"/>
</StackPanel>
</Grid>
</Page>
I expect this:
But when I run it I get this:
Can anyone tell me what I am doing wrong?
Thanks