Exemplo n.º 1
0
        /// <summary>
        /// Indicates that the device orientation provided is one of the two flat modes
        /// </summary>
        /// <param name="deviceOrientation">device orientation</param>
        /// <returns>true if flat</returns>
        public static bool IsFlat(DeviceOrientation deviceOrientation)
        {
            DeviceOrientationInfo deviceOrientationInfo = GetDeviceOrientationInfo(deviceOrientation);

            return(deviceOrientationInfo.NormalGravityVector.Z != 0);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Indicates that the device orientation provided is one of the two landscape modes
        /// </summary>
        /// <param name="deviceOrientation">device orientation</param>
        /// <returns>true if landscape</returns>
        public static bool IsLandscape(DeviceOrientation deviceOrientation)
        {
            DeviceOrientationInfo deviceOrientationInfo = GetDeviceOrientationInfo(deviceOrientation);

            return(deviceOrientationInfo.NormalGravityVector.X != 0);
        }