Пример #1
0
        public Point GetPosition(double actualPopupWidth, double actualPopupHeight)
        {
            var parentPosition = ParentWindow.GetActualPosition();

            switch (_corner)
            {
            case Corner.TopRight:
                return(GetPositionForTopRightCorner(parentPosition, actualPopupWidth, actualPopupHeight));

            case Corner.TopLeft:
                return(GetPositionForTopLeftCorner(parentPosition, actualPopupWidth, actualPopupHeight));

            case Corner.BottomRight:
                return(GetPositionForBottomRightCorner(parentPosition, actualPopupWidth, actualPopupHeight));

            case Corner.BottomLeft:
                return(GetPositionForBottomLeftCorner(parentPosition, actualPopupWidth, actualPopupHeight));

            case Corner.BottomCenter:
                return(GetPositionForBottomCenter(parentPosition, actualPopupWidth, actualPopupHeight));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }