[XAML]How to resize the inner Grid to fill the screen?

 <Grid Grid.RowSpan="2"> <Popup Name="pleaseWait" VerticalAlignment="Stretch" > <Grid Name="pwGrid" Background="#AA000000" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <ProgressRing BorderBrush="White" Height="96" Width="96" IsActive="True"/> <TextBlock Foreground="White" FontSize="32" HorizontalAlignment="Stretch">Loading, please wait...</TextBlock> </StackPanel> </Grid> </Popup> </Grid> </Grid> 

That's my code. Am I doing something wrong?

The pwGrid is not stretching even though the Popup is stretched to fullscreen. The grid only takes enough space to fit the content inside.

I also tried this:

pwGrid.Height = this.Height; pwGrid.Width = this.Width; 

No effect though.

by MrReynevan2 via /r/csharp

Leave a Reply