Popup V2 crashes on app close in an app using Shell and the TitleBar view #2815
-
What is happening: In essence, it uses a class called MainWindow, which inherits from the standard Microsoft.Maui.Controls.Window class. The purpose of this MainWindow class is to set the AppShell as the Window's Page property and give easy access to the TitleBar property. Here's the XAML: ![]() Now that you have context into the setup of the project, here is the part that is actually relevant to the MAUI Community Toolkit: I repurposed the button that came with the default MAUI app template to open a Popup via a Command, following along with much of the guide provided by the PopupService MAUI Docs. The problem is that if at any point during the life of the app the user opens that Popup, upon closing the app, it throws an exception: ![]() The Locals tab after the exception while debugging looks like this: ![]() This issue only started happening after I added the TitleBar/MainWindow setup into the app. Is there anything I can do to prevent the exception from occurring? I have a more complex app that has an identical setup that uses Shell and TitleBar that I am trying to add Popups into and I created a fresh MAUI app to try to identify which part(s) of the app are causing the crashes. Any discussion or help is appreciated. I've uploaded a repo with the code in question here: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
What happens if you replace the popup display code with just showing a ContentPage modally? Do you see the same error? |
Beta Was this translation helpful? Give feedback.
The fact that it reproduces the issue is a good thing. Well certainly for the toolkit because it looks like a MAUI issue. It would be worth raising a bug with that team unless @jfversluis knows of anything around this area?