public void ShowPopup() { GlobalData.AppointmentPopupWindow = new ExtendedPopupWindow(); GlobalData.AppointmentPopupWindow.Touchable = true; GlobalData.AppointmentPopupWindow.Focusable = false; GlobalData.AppointmentPopupWindow.OutsideTouchable = false; Point windowDimensions = new Point(); _activity.WindowManager.DefaultDisplay.GetSize(windowDimensions); int[] itemPosition = new int[2]; _calendarItem.GetLocationOnScreen(itemPosition); Point itemPoint = new Point(itemPosition[POINT_X], itemPosition[POINT_Y]); int itemHeight = _calendarItem.Height; int itemWidth = _calendarItem.Width; //start orientation detection if (_activity.Resources.Configuration.Orientation == Android.Content.Res.Orientation.Portrait) { AdjustPopupInPortraitMode(itemPoint, windowDimensions, itemHeight); } else { AdjustPopupInLandscapeMode(itemPoint, windowDimensions, itemWidth); } UpdateAdapter(); }