The orientation of Windows Phone does not work

advertisements

Orientation code not work but it is correct

private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
            {
                if (e.Orientation == PageOrientation.Landscape)
                {
                    webBrowser1.Visibility = System.Windows.Visibility.Collapsed;
                }
                else
                {

                }
            }

this is code for application call orientation mode:

SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    shell:SystemTray.IsVisible="True" OrientationChanged="PhoneApplicationPage_OrientationChanged">

why?


Change the SupportedOrientations property of the page to PortraitOrLandscape. Replace the default Grid in the Content Panel section with a ScrollViewer and a StackPanel. http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207002%28v=vs.105%29.aspx In detail you will find on same link