Пример #1
0
        private ScreenOrientation MapOrientation(InterfaceOrientationTypes orientation)
        {
            switch (orientation)
            {
            case InterfaceOrientationTypes.All:
                return(ScreenOrientation.FullSensor);

            case InterfaceOrientationTypes.AllButUpsideDown:
                return(ScreenOrientation.FullSensor);

            case InterfaceOrientationTypes.Portrait:
                return(ScreenOrientation.Portrait);

            case InterfaceOrientationTypes.Landscape:
                return(ScreenOrientation.Landscape);
            }

            return(ScreenOrientation.Portrait);
        }
Пример #2
0
        private static UIInterfaceOrientationMask MapOrientation(InterfaceOrientationTypes orientation)
        {
            switch (orientation)
            {
            case InterfaceOrientationTypes.All:
                return(UIInterfaceOrientationMask.All);

            case InterfaceOrientationTypes.AllButUpsideDown:
                return(UIInterfaceOrientationMask.AllButUpsideDown);

            case InterfaceOrientationTypes.Portrait:
                return(UIInterfaceOrientationMask.Portrait);

            case InterfaceOrientationTypes.Landscape:
                return(UIInterfaceOrientationMask.Landscape);
            }

            return(UIInterfaceOrientationMask.Portrait);
        }
Пример #3
0
 private void NewOrientationRequested(object sender, InterfaceOrientationTypes arg)
 {
     RequestedOrientation = MapOrientation(arg);
 }
Пример #4
0
 public RotationAwarePage(InterfaceOrientationTypes requestedOrientation)
 {
     RequestedOrientation = requestedOrientation;
 }