diff options
Diffstat (limited to 'Xamarin.Forms.Core/DeviceOrientationExtensions.cs')
-rw-r--r-- | Xamarin.Forms.Core/DeviceOrientationExtensions.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/DeviceOrientationExtensions.cs b/Xamarin.Forms.Core/DeviceOrientationExtensions.cs new file mode 100644 index 00000000..8dbaaa82 --- /dev/null +++ b/Xamarin.Forms.Core/DeviceOrientationExtensions.cs @@ -0,0 +1,15 @@ +namespace Xamarin.Forms +{ + internal static class DeviceOrientationExtensions + { + public static bool IsLandscape(this DeviceOrientation orientation) + { + return orientation == DeviceOrientation.Landscape || orientation == DeviceOrientation.LandscapeLeft || orientation == DeviceOrientation.LandscapeRight; + } + + public static bool IsPortrait(this DeviceOrientation orientation) + { + return orientation == DeviceOrientation.Portrait || orientation == DeviceOrientation.PortraitDown || orientation == DeviceOrientation.PortraitUp; + } + } +}
\ No newline at end of file |