none
如和处理wp8.1屏幕旋转事件?OrientationChanged好像不能用啊 RRS feed

  • 问题

  • 如和处理wp8.1屏幕旋转事件?OrientationChanged好像只支持wp8.0,在8.1中怎么处理屏幕旋转事件呢
    2015年2月10日 16:46

答案

  • 你好,

    >>OrientationChanged好像只支持wp8.0,在8.1中怎么处理屏幕旋转事件呢

    WP8.1 RT 中我们需要使用DisplayInformation.OrientationChanged 事件:https://msdn.microsoft.com/zh-cn/library/windows/apps/windows.graphics.display.displayinformation.orientationchanged

    DisplayInformation displayInformation = DisplayInformation.GetForCurrentView();
    
    private void Page_Loaded(object sender, RoutedEventArgs e)
    {
                displayInformation.OrientationChanged += Page_OrientationChanged;
    }
    
    private void Page_OrientationChanged(DisplayInformation sender, object args)
    {
                Debug.WriteLine(sender.CurrentOrientation);
    }


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2015年2月11日 4:23
    版主