summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/DeviceOrientationExtensions.cs
blob: 8dbaaa8208e094d98ddc3b3fcac5601f5145a8db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
namespace Xamarin.Forms
{
	internal static class DeviceOrientationExtensions
	{
		public static bool IsLandscape(this DeviceOrientation orientation)
		{
			return orientation == DeviceOrientation.Landscape || orientation == DeviceOrientation.LandscapeLeft || orientation == DeviceOrientation.LandscapeRight;
		}

		public static bool IsPortrait(this DeviceOrientation orientation)
		{
			return orientation == DeviceOrientation.Portrait || orientation == DeviceOrientation.PortraitDown || orientation == DeviceOrientation.PortraitUp;
		}
	}
}