I solved this problem! If you want that your windows 10 universal app toggle from portrait to landscape orientation:
- In construct 2 for lock app in portrait orientation:
On start of layout -> Execute javascript: "Windows.Graphics.Display.DisplayInformation.autoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.portrait;"
- For toggle to landscape orientation:
On start of layout or On touched object -> Execute javascript: "Windows.Graphics.Display.DisplayInformation.autoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.landscape;"
- In visual studio 2015 open package.appxmanifest your app and set in Aplications tab supported rotations - landscape and portraite.