I will explain what I am trying to do in the following instance:
I have two pages - MainPage.xaml (orientation portrait) and LandscapeLeft.xaml (LandscapeLeft orientation).
I want to go from MainPage.xamlto LandscapeLeft.xamlwhen the user rotates the phone in the Lanscape position.
I have done the following:
XAML:
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
code behind:
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
{
switch (e.Orientation)
{
case PageOrientation.LandscapeLeft:
NavigationService.Navigate(new Uri("/LandscapeLeft.xaml", UriKind.RelativeOrAbsolute));
break;
}
base.OnOrientationChanged(e);
}
When I rotate the phone from PortraitUp to LandscapeLeft, what happens:
Firstly, the contents of MainPage.xaml rotates the landscape, and that's when LandscapeLeft.xaml loads.
, MainPage.xaml. . , , LandscapeLeft.xaml
MainPage.xaml.
, - ?