I would like to determine the current orientation of the device in a WP7 app. I do not want to handle the OrientationChange event, because I need the current orientation when the page is opened.
I've been trying to do it with this piece of code I found in a forum:
((PhoneApplicationFrame)Application.Current.RootVisual).Orientation
However, this always returns with PortraitUp, even if I turn the device sideways. And by the way, I am trying to do this with the emulator, so it might be an emulator-bug.
Thanks
Just tested it on the emulator and on my device. In the emulator it's like Mark is metioning it's always returning PotraitUp.
However if i test it on my device than the correct orientation is directly returned. So probably as Mark is suggesting it's a emulator bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With