summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8/Extensions.cs
blob: d3eb9209eb9bb3ab35add5ee9510dbc5746ee276 (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
31
´╗┐using Microsoft.Phone.Controls;
using Xamarin.Forms.Internals;

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;
			}
		}
	}
}