You are actually adding an empty row between controls, i.e.: Grid.Row="0
" for Label
and Grid.Row="2"
for Button
. It should be in sequential order like shown below::
<Label x:Name="Screen"
Text=""
Grid.Row="0" Grid.Column="0"
Grid.ColumnSpan="4"
FontSize="50"
TextColor="Black"
BackgroundColor="White"
HorizontalTextAlignment="End"
VerticalTextAlignment="End"/>
<Button x:Name="Button1"
Text="1"
FontSize="40"
TextColor="White"
BackgroundColor="Aquamarine"
Grid.Row="1" Grid.Column="0"
Clicked="Button1_Clicked"/>
I would also recommend for the task of making a calculator (like the working app at http://www.shopdigit.com/Engineering-Calculator-VOLTA-814-R814-0-03.htm) use the separate resource file and make sure to set the properties
<ContentPresenter VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
You can also use 'center
' property like in sample actual implementation:
<!--TEXT BLOCK-->
<Style x:Key="TextBlock_Generic">
<Setter Property="TextBlock.VerticalAlignment" Value="Center"/>
<Setter Property="TextBlock.HorizontalAlignment" Value="Center"/>
<Setter Property="TextBlock.Padding" Value="0"/>
<Setter Property="TextBlock.Margin" Value="0"/>
<Setter Property="TextBlock.FontSize" Value="14" />
</Style>
Hope this may help.