4
A
回答
4
我自己刚刚看过windows 7手机(通过vs2010 express手机版)。
似乎在代码中有这背后
public MainPage()
{
InitializeComponent();
// seems to set the supported orientations that your program will support.
SupportedOrientations = SupportedPageOrientation.Portrait | SupportedPageOrientation.Landscape;
}
然后实际的形式有
private void PhoneApplicationPage_OrientationChanging(object sender, OrientationChangedEventArgs e)
{
var test = e.Orientation;
}
因此,当方向改变它e.Orientation会告诉你它是什么方向。像LandscapeRight一样。
0
您也可以通过this.Orientation询问您的应用程序何时启动,以便知道方向是什么。在开始之后,您可以使用OrientationChanged事件。
在你的主:
OrientationChanged += new EventHandler<OrientationChangedEventArgs>(MainPage_OrientationChanged);
void MainPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
{
Console.WriteLine(e.Orientation.ToString());
}
2
你也不必只通过事件追踪这一点,你可以从实例的PhoneApplicationPage直接问它:
private void Button_Click(object sender, RoutedEventArgs e)
{
MyCurrentOrientation.Text = this.Orientation.ToString();
}
相关问题
- 1. 如何在XNA游戏中确定Windows Phone 7的方向?
- 2. LocalStorage重定向Windows Phone 7
- 3. 如何 - Windows Phone 7?
- 4. Windows Phone 7响应重定向
- 5. 如何更改Windows Phone 7中的图像方向
- 6. 如何处理windows phone 7中的方向?
- 7. WP7(Windows phone 7)在XAML或C中锁定手机方向#
- 8. Windows Phone 7上的双向通信
- 9. 检测Windows Phone的方向
- 10. Azure + Windows phone 7
- 11. XmlConvert.ToDateTime Windows Phone 7
- 12. IsolatedStorage @Windows Phone 7
- 13. windows phone 7 appstore?
- 14. Windows Phone 7:SQLite
- 15. Windows Phone 7 textBox
- 16. JQTouch Windows Phone 7
- 17. WCF + Windows Phone 7
- 18. Windows 7 PHONE - KeyNotFoundException
- 19. Windows Phone 7 SDK
- 20. 为Windows Phone 7
- 21. 的Windows Phone 7 SDK
- 22. Windows phone 7如何向已发布的应用添加国家
- 23. 如何“Windows Phone 7中的CSS3渐变”?
- 24. 如何设置Windows Phone 7仿真器的默认/启动方向?
- 25. 重定向IE7浏览器,但无法在Windows Phone 7的
- 26. 在WebBrowser/Windows Phone 7中导航。错误的重定向
- 27. 如何确定在Windows Phone 7数字键盘中按下的键的值?
- 28. 在Windows Phone 7中的网格绑定?
- 29. Windows Phone 7 API + SSL
- 30. Windows Phone 7 ASX Streaming