summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8/Extensions.cs
blob: 844c75ab504b9b7c4d3b6baa35f4797b115a7c98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
´╗┐using Microsoft.Phone.Controls;

namespace Xamarin.Forms.Platform.WinPhone
{
	internal static class Extensions
	{
		public static DeviceOrientation ToDeviceOrientation(this PageOrientation pageOrientation)
		{
			switch (pageOrientation)
			{
				case PageOrientation.None:
					return DeviceOrientation.Other;
				case PageOrientation.Portrait:
					return DeviceOrientation.Portrait;
				case PageOrientation.Landscape:
					return DeviceOrientation.Landscape;
				case PageOrientation.PortraitUp:
					return DeviceOrientation.PortraitUp;
				case PageOrientation.PortraitDown:
					return DeviceOrientation.PortraitDown;
				case PageOrientation.LandscapeRight:
					return DeviceOrientation.LandscapeRight;
				case PageOrientation.LandscapeLeft:
					return DeviceOrientation.LandscapeLeft;
				default:
					return DeviceOrientation.Other;
			}
		}
	}
}