Skip to content

Commit 6f34dae

Browse files
authored
Merge pull request #596 from uk-taniyama/pr-wpf-fix-position
fix WPF Popup position.
2 parents 65e5ae5 + a3cd124 commit 6f34dae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Rg.Plugins.Popup/Platforms/Wpf/Renderers/PopupPageRenderer.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Windows;
3+
using System.Windows.Controls.Primitives;
34
using Rg.Plugins.Popup.Pages;
45
using Rg.Plugins.Popup.WPF.Renderers;
56
using Xamarin.Forms;
@@ -21,6 +22,7 @@ public class PopupPageRenderer : PageRenderer
2122
internal void Prepare(WinPopup container)
2223
{
2324
Container = container;
25+
Container.Placement = PlacementMode.Absolute;
2426

2527
if (Application.Current.MainWindow != null)
2628
Application.Current.MainWindow.SizeChanged += OnSizeChanged;
@@ -74,8 +76,8 @@ private void UpdateElementSize()
7476
CurrentElement.Layout(rectangle);
7577

7678
CurrentElement.BatchCommit();
77-
Container.VerticalOffset = rectangle.X;
78-
Container.HorizontalOffset = rectangle.Y;
79+
Container.VerticalOffset = rectangle.Y;
80+
Container.HorizontalOffset = rectangle.X;
7981
}
8082
}
8183
}

0 commit comments

Comments
 (0)