summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/DeviceOrientationExtensions.cs
blob: 9dc97694831570a20737dfcbdad206880847cdb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System.ComponentModel;

namespace Xamarin.Forms.Internals
{
	public static class DeviceOrientationExtensions
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static bool IsLandscape(this DeviceOrientation orientation)
		{
			return orientation == DeviceOrientation.Landscape || orientation == DeviceOrientation.LandscapeLeft || orientation == DeviceOrientation.LandscapeRight;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static bool IsPortrait(this DeviceOrientation orientation)
		{
			return orientation == DeviceOrientation.Portrait || orientation == DeviceOrientation.PortraitDown || orientation == DeviceOrientation.PortraitUp;
		}
	}
}