Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Strange behavior when pushing Rg.Plugins.PopupPage with Prism

pacomaralpacomaral Member ✭✭

I'm having a problem when I try to push a PopupPage with Prism's Navigation Service.

The problem is that, when I call the method 'NavigateAsync("PopupName")', the INavigation result object says that 'Success' is false. If I inspect the Exception, it is throwing the following message:

Cannot remove root page when it is also the currently displayed page.

The strange thing is that despite this, the PopupPage is showing in the device.

I'm not sure if I'm doing something wrong in the navigation:

1 - In the App.Xaml.cs, I navigate to my MainPage:

var oResult = await NavigationService.NavigateAsync("NavigationPage/MyMainPage");

2 - In my MainPage, I have a button which call a process to open the popup, using the Relative navigation:

var oResult = await NavigationService.NavigateAsync("MyPopup");

At this point, is where 'oResult' says that the Navigation was incorrect.

Am I doing something wrong? If I navigate to another page which is not a Popup, it nagivates without problems.

Best Answer

  • pacomaralpacomaral Member ✭✭
    Accepted Answer

    @ColeX said:
    This is a known issue , Prism cannot and will not directly support 3rd part libraries like Rg.Plugins.Popup... however it is supported with Prism.Plugin.Popups .

    Check https://github.com/PrismLibrary/Prism/issues/1400 .

    Forgot to note that I am already using the Prism.Plugin.Popups.

    Anyway, I found out that the error was mine. I was navigating to the popups from an utility class and the navigation object that I was using was of the previous window, not current. I didn't notice this until I inspected the navigation result object, as it was pushing the popups with no problem.

    My bad.

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    This is a known issue , Prism cannot and will not directly support 3rd part libraries like Rg.Plugins.Popup... however it is supported with Prism.Plugin.Popups .

    Check https://github.com/PrismLibrary/Prism/issues/1400 .

  • pacomaralpacomaral Member ✭✭
    Accepted Answer

    @ColeX said:
    This is a known issue , Prism cannot and will not directly support 3rd part libraries like Rg.Plugins.Popup... however it is supported with Prism.Plugin.Popups .

    Check https://github.com/PrismLibrary/Prism/issues/1400 .

    Forgot to note that I am already using the Prism.Plugin.Popups.

    Anyway, I found out that the error was mine. I was navigating to the popups from an utility class and the navigation object that I was using was of the previous window, not current. I didn't notice this until I inspected the navigation result object, as it was pushing the popups with no problem.

    My bad.

Sign In or Register to comment.