How to detect WP7 native resolution?
I realize there's only one resolution currently, but this would be nice to know. I'd also like to know how to set th开发者_运维百科e orientation to portrait. I've managed to do it by setting the backbuffer size, but this doesn't seem right.
This is the way it should be done:
ScreenWidth = System.Windows.Application.Current.Host.Content.ActualWidth;
ScreenHeight = System.Windows.Application.Current.Host.Content.ActualHeight;
You can set the default Orientation for the PhoneApplicationPage to Portrait with the Orientation property of the page, but you cannot force the Orientation change in any other way than rotating the device itself.
加载中,请稍侯......
精彩评论