diff --git a/Perspex.Controls/Popup.cs b/Perspex.Controls/Popup.cs index 0aa644b60d..746ef04278 100644 --- a/Perspex.Controls/Popup.cs +++ b/Perspex.Controls/Popup.cs @@ -296,23 +296,23 @@ namespace Perspex.Controls /// The popup's position in screen coordinates. private Point GetPosition() { - var target = this.PlacementTarget ?? this.GetVisualParent(); + var target = this.PlacementTarget ?? this.GetVisualParent(); Point point; - switch (this.PlacementMode) - { - case PlacementMode.Bottom: - point = target.Bounds.BottomLeft; - break; - case PlacementMode.Right: - point = target.Bounds.TopRight; - break; - default: - throw new InvalidOperationException("Invalid value for Popup.PlacementMode"); - } - if (target != null) { + switch (this.PlacementMode) + { + case PlacementMode.Bottom: + point = new Point(0, target.Bounds.Height); + break; + case PlacementMode.Right: + point = new Point(target.Bounds.Width, 0); + break; + default: + throw new InvalidOperationException("Invalid value for Popup.PlacementMode"); + } + return target.PointToScreen(point); } else