Q:

Getting the orientation in windows phone native/xaml app

To apply orientation support to my game, I have been trying to get the screen orientation via 
Windows::Graphics::Display::DisplayProperties::CurrentOrientation

But this throws an immediate exception.  I searched on the net what might be the cause of it, but couldnt find any helpful resources.  In this link , http://developer.nokia.com/community/discussion/showthread.php/246733-DisplayProperties-CurrentOrientation-not-supported-in-XAML-app a similar exception is discussed , and as a solution using App. RootFrame. Orientation in c# side is proposed.  
But I need to get the orientation in native code.  What could you suggest on this? 

A:

You could use the Accelerometer sensor to get the exact orientation when the device doesn't move much or simply use the Frame dimensions.