Forum Xamarin Xamarin.Forms

How to prevent unwanted Backbutton when dealing with query parameters

go74go74 Member ✭✭

Hi,
I'm building my Flyout in codebehind. I need to call a view passing a parameter, but when this views gets displayed a Backbutten is displayed instead of the Hamburger/Flyout-Button.

Not only is that behaviour unwanted, but when used it opens the very same page, this time displaying the wanted Hamburger/Flyout-Button.

1.) I registered the Route like that:

Routing.RegisterRoute(nameof(Container), typeof(Container));

2.) I create my FlyoutItem(s) like that:

If I don't pass the parameter, the Hamburger/Flyout-Button is displayed as desired.

Any help/suggestion would be very much appreciated.

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    This is expected behavior , Hamburger icon represents currently it locates at root page (inside navigation stack ), Back button shows you can go back to previous page .

  • go74go74 Member ✭✭

    Okay, so why exactly is my page outside of the navigation stack if I call it with a parameter and how do I prevent it being outside of the navigation stack while using a parameter?

  • ColeXColeX Member, Xamarin Team Xamurai

    Could you provide a basic ,minimal sample for testing ? Zip your project and upload it in the comment .

  • go74go74 Member ✭✭

    @ColeX said:
    Could you provide a basic ,minimal sample for testing ? Zip your project and upload it in the comment .

    Sure. Done.

  • ColeXColeX Member, Xamarin Team Xamurai

    I'm afraid this is by design , passing parameters into existing Route would create a new navigation stack .

    You could raise this issue in github : https://github.com/xamarin/Xamarin.Forms/issues .

  • go74go74 Member ✭✭

    Oh dear, that's bad. Thanks for checking it out though.

Sign In or Register to comment.