locked
How can i apply available full height & width of display to UI element or Grid ? RRS feed

  • Question

  • Hi,

    Please suggest me , how can i apply Full height and width to grid depending on orientation changes.

    eg.  Landscape : Width = 1366 / Height=768 

           Portrait : Height = 1366 / Width=768

    I want this to be done by using XAML and VisualstateManager

    Thanks,


    C Mahone


    • Edited by C Mahone Tuesday, August 27, 2013 4:36 PM Typo
    Tuesday, August 27, 2013 4:35 PM

Answers

  • If you don't set Width and Height on the Grid it will default to the full screen size. You don't need to explicitly manipulate it. Give it a try with a default test app to see how it works.

    Alternately you can listen for CoreWindow.SizeChanged to trigger VisualStateManager changes as desired, but typically you would do that to switch between controls (GridView for landscape, ListView for thin portraits, etc.) rather than to change the size of the root Grid.

    --Rob

    • Marked as answer by Anne Jing Monday, September 2, 2013 1:42 AM
    Tuesday, August 27, 2013 5:24 PM
    Moderator