[Bug] PopupHandler is incompatible
See original GitHub issueDescription
Showing a popup based on XAML leads to the error
CommunityToolkit.Maui.Core.Handlers.PopupHandler found for TestApp.ProfilePopup is incompatible
Steps to Reproduce
- Create a new MAUI Application
- Install CommunityToolkit
- Create a Popup-XAML
- Change the
OnCounterClicked
inMainpage
to show popup usingthis.ShowPopup(popup)
XAML:
<?xml version="1.0" encoding="utf-8" ?>
<toolkit:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="TestApp.ProfilePopup">
<VerticalStackLayout>
<Label Text="This is a very important message!" />
</VerticalStackLayout>
</toolkit:Popup>
OnCounterClicked:
private void OnCounterClicked(object sender, EventArgs e)
{
var popup = new ProfilePopup();
this.ShowPopup(popup);
}
Creating the popup in Code works as expected:
private void OnCounterClicked(object sender, EventArgs e)
{
var popup = new Popup
{
Content = new VerticalStackLayout
{
Children =
{
new Label
{
Text = "This is a very important message!"
}
}
}
};
this.ShowPopup(popup);
}
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
.NET MAUI Community Toolkit Popup PopupHandler is ...
I reproduced the error message. THE CAUSE: "I've no partial class for this popup". That won't work. without that, there is no ...
Read more >Incompatible ButtonHandler when embedding MAUI page ...
I'm testing out embedding MAUI pages into a new .NET 6 Android-project using this guide. When I try to embed a page that...
Read more >Success with GWT 2.7.0-rc1
error or warning. My first attempt to launch the devmode UI told me that firebugHandler and popupHandler were no longer supported--something I'd
Read more >Unhandled popups? - Deadline - Thinkbox Forums
It seems that the popup handler kicks in as soon as we give window focus to the rendering application, but does not if...
Read more >Manage unexpected pop-ups
For the bot that you want to enable the pop-up handler, click the actions menu (vertical ellipsis). Click Run Task Bot.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The bug is in poster’s code, not in Toolkit Popup. I explain what was done wrong in my StackOverflow answer.
(There is no ProfilePopup.xaml.cs file, so no
InitializeComponent
call.)@gironymo thanks for this feedback, we have assumed some initial knowledge around XAML files with our documentation specifically around this page: https://docs.microsoft.com/en-gb/dotnet/maui/xaml/fundamentals/get-started#anatomy-of-a-xaml-file
I appreciate that even the linked page doesn’t give a good insight to developers new to XAML.
We can look to add something else to improve our documentation pages though.