From 0e8da232e4d2df6105ab58f1a2bf5632cb783d81 Mon Sep 17 00:00:00 2001 From: James Crutchley Date: Tue, 28 Jan 2025 06:53:48 -0800 Subject: [PATCH 1/2] Fix XamlRoot being set incorrectly in Popup Handler when using modal navigation in Windows --- .../Handlers/Popup/PopUpHandler.windows.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CommunityToolkit.Maui.Core/Handlers/Popup/PopUpHandler.windows.cs b/src/CommunityToolkit.Maui.Core/Handlers/Popup/PopUpHandler.windows.cs index 132bab03f1..0ea2845638 100644 --- a/src/CommunityToolkit.Maui.Core/Handlers/Popup/PopUpHandler.windows.cs +++ b/src/CommunityToolkit.Maui.Core/Handlers/Popup/PopUpHandler.windows.cs @@ -41,9 +41,8 @@ public static void MapOnOpened(PopupHandler handler, IPopup view, object? result ArgumentNullException.ThrowIfNull(handler.MauiContext); var parent = view.Parent.ToPlatform(handler.MauiContext); - parent.IsHitTestVisible = false; - handler.PlatformView.XamlRoot = parent.XamlRoot; + handler.PlatformView.XamlRoot = view.GetWindow().Content?.Handler?.MauiContext?.GetPlatformWindow().Content.XamlRoot ?? throw new InvalidOperationException("Window Content cannot be null"); handler.PlatformView.IsHitTestVisible = true; handler.PlatformView.IsOpen = true; From 770ec6074c8e29c7bb1bb05b11907e527ff0bdd1 Mon Sep 17 00:00:00 2001 From: James Crutchley Date: Tue, 28 Jan 2025 07:30:32 -0800 Subject: [PATCH 2/2] Updated `PopupSizeConstants` to not make sample app popup size too large when testing Mulitple popups page --- samples/CommunityToolkit.Maui.Sample/Models/PopupSize.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/CommunityToolkit.Maui.Sample/Models/PopupSize.cs b/samples/CommunityToolkit.Maui.Sample/Models/PopupSize.cs index b8e21cebfe..88cef5a44d 100644 --- a/samples/CommunityToolkit.Maui.Sample/Models/PopupSize.cs +++ b/samples/CommunityToolkit.Maui.Sample/Models/PopupSize.cs @@ -6,8 +6,8 @@ public PopupSizeConstants(IDeviceDisplay deviceDisplay) { Tiny = new(100, 100); Small = new(300, 300); - Medium = new(0.7 * (deviceDisplay.MainDisplayInfo.Width / deviceDisplay.MainDisplayInfo.Density), 0.6 * (deviceDisplay.MainDisplayInfo.Height / deviceDisplay.MainDisplayInfo.Density)); - Large = new(0.9 * (deviceDisplay.MainDisplayInfo.Width / deviceDisplay.MainDisplayInfo.Density), 0.8 * (deviceDisplay.MainDisplayInfo.Height / deviceDisplay.MainDisplayInfo.Density)); + Medium = new(0.4 * (deviceDisplay.MainDisplayInfo.Width / deviceDisplay.MainDisplayInfo.Density), 0.6 * (deviceDisplay.MainDisplayInfo.Height / deviceDisplay.MainDisplayInfo.Density)); + Large = new(0.5 * (deviceDisplay.MainDisplayInfo.Width / deviceDisplay.MainDisplayInfo.Density), 0.8 * (deviceDisplay.MainDisplayInfo.Height / deviceDisplay.MainDisplayInfo.Density)); } // examples for fixed sizes