Windows phone 8 popup width and height

I place the grid in a popup control. I expected the grid to be resized automatically according to three different layout sizes for Windows 8 applications ( 480 × 800, 768 × 1280, 720 × 1280 ).

But it seems to me that I would need to set the width and height of the grid explicitly , because it redefines itself according to the size of the child control, whereas I need a pop-up window that will be shown as full at the top of the screen for all three resolutions.

Any help?

+3
source share
1 answer

WP8 - Child . WP8 Multi-resolution zen WP8 API .

private void Button_Click_1(object sender, RoutedEventArgs e)
{
    var myPopup = new Popup()
    {
        Child = new Border()
        {
            Child = new TextBlock()
                    {
                        Text = "Hello World!"
                    },
            Height =  Application.Current.Host.Content.ActualHeight,
            Width =  Application.Current.Host.Content.ActualWidth,
            Background = new SolidColorBrush(Colors.Green)
        }
    };

    this.LayoutRoot.Children.Add(myPopup);
    myPopup.IsOpen = true; 
}

, (, SystemTray, AplicaitonBar ..) .

WXGA:

Full screen popup on WXGA

720P: Full screen popup on 720P

+29

Source: https://habr.com/ru/post/1545667/


All Articles