question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] PopupHandler is incompatible

See original GitHub issue

Description

Showing a popup based on XAML leads to the error

CommunityToolkit.Maui.Core.Handlers.PopupHandler found for TestApp.ProfilePopup is incompatible

Steps to Reproduce

  1. Create a new MAUI Application
  2. Install CommunityToolkit
  3. Create a Popup-XAML
  4. Change the OnCounterClicked in Mainpage to show popup using this.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:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ToolmakerStevecommented, Jun 6, 2022

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.)

0reactions
bijingtoncommented, Jun 6, 2022

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found