开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜