maui-linux/Xamarin.Forms.Platform.WP8/Extensions.cs

30 строки
863 B
C#
Исходник Обычный вид История

2016-03-22 23:02:25 +03:00
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;
}
}
}
}