Irrespective of the orientation of device my app should run in portrait mode only.
Every page except only one page should run on the landscape.
How can I achieve this?
I tried below things:
On manifest file, I have checked supported rotation to "portrait" only. And written below code on the page I need to show in a landscape,
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape | DisplayOrientations.LandscapeFlipped;
}
But when run with simulator, it works in both portrait and landscape mode. What is the reason for it?
I have to rotate the simulator to 90 degree for seeing the app in portrait mode.