Windows phone 7 单击emulator按钮,为PageOrientation.LandscapeRight显示差异图像

Windows phone 7 单击emulator按钮,为PageOrientation.LandscapeRight显示差异图像,windows-phone-7,Windows Phone 7,页面以“Partrait”开头,我有代码来捕捉用户控件的方向变化。我不明白为什么要通过改变顺序来显示相同代码上的差异,从而按emulator上的按钮在屏幕上漫游。下面是我捕获定向更改事件的代码 if (previousOrientation == PageOrientation.PortraitUp && e.Orientation == PageOrientation.LandscapeLeft) { this.LayoutRoot.W

页面以“Partrait”开头,我有代码来捕捉用户控件的方向变化。我不明白为什么要通过改变顺序来显示相同代码上的差异,从而按emulator上的按钮在屏幕上漫游。下面是我捕获定向更改事件的代码

 if (previousOrientation == PageOrientation.PortraitUp && e.Orientation == PageOrientation.LandscapeLeft)
        {
            this.LayoutRoot.Width = 730;
            lst.lst.Height = 220;
            lst.lst.Width = 730;
            this.LayoutRoot.Margin = new Thickness(0, 0, 0, 0);
            this.TitlePanel.Margin = new Thickness(0, 0, 65, 0);


        }
        if (e.Orientation.ToString().Contains("Portrait"))
        {
            this.LayoutRoot.Width = 480;
            this.LayoutRoot.Margin = new Thickness(0, 0, 0, 0);
            lst.lst.Height = 400;
            lst.lst.Width = 450;
            this.TitlePanel.Margin = new Thickness(12, 0, 40, 0);
            this.TitlePanel.Margin = new Thickness(12, 17, 2, 0);

        }

当我第二次按下emulator上的第一个按钮以旋转屏幕时,(
previousOrientation==PageOrientation.GraphitalUp&&e.Orientation==PageOrientation.LandscapeRight
)被触发。它显示大应用程序栏的背景黄色

如果我第一次按下emulator上的第二个按钮旋转屏幕,将触发同一行“(
previousOrientation==PageOrientation.GraphitalUp&&e.Orientation==PageOrientation.LandscapeRight
)”。它显示了我想要的窄应用程序条的背景黄色


由于我是一个新用户,我无法上传图像。如果你对我的问题感兴趣,我可以把图片发给你。提前谢谢

我浏览了以下网站的论坛。看来是虫子


“第一个按钮上的第二次”和“第二个按钮上的第一次”。。我不明白。但您的代码工作正常。详细说明你的问题abit@nkchandra,emulator上的第一个按钮旋转左侧的屏幕。sceond按钮可旋转手机的右侧。虽然代码是相同的(在previousOrientation==PageOrientation.GraphitalUp和&e.Orientation==PageOrientation.LandscapeRight上激发),但显示是不同的。那么您在哪里更新previousOrientation字段的值呢?@nkchandra,我在Orientationchanged事件处理程序上更新它。