summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8/Extensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.WP8/Extensions.cs')
-rw-r--r--Xamarin.Forms.Platform.WP8/Extensions.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WP8/Extensions.cs b/Xamarin.Forms.Platform.WP8/Extensions.cs
new file mode 100644
index 00000000..844c75ab
--- /dev/null
+++ b/Xamarin.Forms.Platform.WP8/Extensions.cs
@@ -0,0 +1,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;
+ }
+ }
+ }
+} \ No newline at end of file