MonoMobile.Views.UIDeviceExtensions.GetActualWidth C# (CSharp) Method

GetActualWidth() public static method

public static GetActualWidth ( this device ) : float
device this
return float
		public static float GetActualWidth(this UIDevice device)
		{
			var orientation = device.Orientation;
			
			var landscape = orientation == UIDeviceOrientation.LandscapeLeft || orientation == UIDeviceOrientation.LandscapeRight;

			if (landscape)
				return UIScreen.MainScreen.Bounds.Height;
			else
				return UIScreen.MainScreen.Bounds.Width;
		}