locked
How to handle screen rotation

    Question

  • I am writing a Windows Phone 8.1 app and I want to make the XAML do different things when it's in landscape -vs- when it's in protrait.  I can't find a way to capture the event of a screen orientation change.  Is there one?  
    Friday, September 12, 2014 8:54 PM

Answers

  • Check out DisplayInformation.OrientationChanged . A typical strategy is to set up visual states for landscape and portrait.

    You can also look for the Window.SizeChanged event . That one works better on Windows since it can handle intermediate sizes as well as full landscape vs. portrait.

    Friday, September 12, 2014 8:59 PM
    Owner