How to limit orientation in metro apps?

landscape, microsoft-metro, windows-8, wpf

Solution

As explained in this link the orientation limitation preference setting of the app is only enforced on a Windows 8 system with a supported HARDWARE ACCELEROMETER. This means that unless Windows knows how the system is orientated through the means of a supported sensor, it will not attempt to switch to the app's preferred orientation.

So it will all depend on the user's hardware.

Problem

In my app, all of the stuff is only in Landscape mode. I don't want the app to be functional in Portrait mode. How do I limit the orientation? Thanks.

Original source