Reputation: 1145
Is there way to programmatically lock screen orientation in Windows 10 universal app?
We need to lock screen orientation to portrait mode only on phone. On non-phone it can rotate.
Upvotes: 0
Views: 3363
Reputation: 990
I have created a sample trying to lock the rotation.Unfortunatelly locking the orientation is not working on a Toshiba Windows 10 Tablet. Every time we rotate the tablet the UI is auto rotated even though we are declaring support just for portrait. It seems that in some tablets locking the orientation is not possible. Also I tested same example on a Lumia 550 and orientation was locked. Rotating the mobile did not changed the UI orientation.
Upvotes: 0
Reputation: 1805
Check out the answer from this post: Universal App Windows Phone Orientation
Under WinRT you can have a look at DisplayInformation class, where you will find probably all you need.
You can also declare your supported rotations in Package.appxmanifest file in Supported rotations.
Here you can download an example of an App with three Pages, each with different orientation.
Upvotes: 2