Centering RelativePanels in UWP C#

Viewed 731

I'm trying to set HorizontalAlignment and VerticalAlignment to Center so that the RelativePanel will be right in the middle of the UWP app. There are children items inside the RelativePanel, and the children are supposed to be centered inside the RelativePanel. It's supposed to look like:enter image description hereAs you can see, the RelativePanel is in the middle, and the children are on top of each other and centered. I tried this XAML code:

<RelativePanel x:Name="relativePanel1" HorizontalAlignment="Center" VerticalAlignment="Center">
    <TextBlock x:Name="textBlock1" Text="Yo, waddup? Enter your GUID to continue" IsTextSelectionEnabled="True" FontFamily="Chiller" FontSize="72" HorizontalAlignment="Center" VerticalAlignment="Center" />
    <TextBox x:Name="textBox1" AcceptsReturn="True" HorizontalAlignment="Center" InputScope="Text" PlaceholderText="{}{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" RelativePanel.Below="textBlock1" VerticalAlignment="Center" />
</RelativePanel>

Here's how it looks like when debugging:

enter image description hereAm I doing something wrong in here? I'm using a RelativePanel instead of a StackPanel because I need the two children on top of each other.

1 Answers
Related