Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin App Shell - closing the flyout menu in code

The design of my app requires that I have a button in the Flyout Header, a separate view, which navigates to a page

Unlike the flyout items themselves though, when I click on the button, the page loads under the flyout header which stays open

Is there a way to have a button mimic exactly what happens when navigating within the flyout contents themselves?

The page I'm trying to navigate to is registered as a route in AppShell

The code in the view referenced in FlyoutHeader calls it from the button click like so

     await Shell.Current.GoToAsync("thepage");

As mentioned above the flyout menu is open at this point in order to access the button but when clicked it loads the desired page but I want it to automatically shut the menu

Is there a way to do this please?

like image 856
Journeyman1234 Avatar asked Nov 30 '25 16:11

Journeyman1234


1 Answers

As Ricardo says above.

You can use Shell.Current.FlyoutIsPresented = false;

like image 112
Journeyman1234 Avatar answered Dec 06 '25 21:12

Journeyman1234



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!