There are multiple ways you can get this working.
One of the easiest way you can do this is to set the Canvas.ZIndex
attribute of the StackPanel
. By default, the ZIndex of the elements is 0 so every element is on the same level, due to which the image hides the StackPanel
. (More info on ZIndex)
Updated XAML :
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Image Stretch="Fill" Source="Assets/starsky.png"/>
<StackPanel Canvas.ZIndex="1" >
<TextBlock Name="ResultTextBlock"/>
<Button Content="Get Weather" Click="Button_Click"/>
</StackPanel>
</Grid>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…