How does one disable the Shell Flyout menu button (upper left, by back button) only on a certain Content Page?

Daniel Donnelly, Jr 86 Reputation points
2023-04-16T20:37:48.9966667+00:00

This is how I've disabled the back button on my "LoginPage.xaml".

    <Shell.BackButtonBehavior>
        <BackButtonBehavior IsVisible="False" IsEnabled="False" />
    </Shell.BackButtonBehavior>

Clearly, I don't want people to simply open the Shell Flyout menu and navigate away without having to login. So I need to disable that Flyout button at the top of the page. Not sure how to do that.

There seems to be no consistent, analogous interface in order to disable it the same way I've done with the back button.

Please help!

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,135 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
781 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Daniel Donnelly, Jr 86 Reputation points
    2023-04-16T20:41:59.8266667+00:00

    Found it, yo!

    <ContentPage x:Class="CEDDashboard.View.LoginPage"
                 xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:vm="clr-namespace:CEDDashboard.ViewModel"
                 xmlns:local="clr-namespace:CEDDashboard.View"
                 x:DataType="vm:LoginViewModel"
                 Shell.NavBarIsVisible="False"
                 Shell.FlyoutBehavior="Disabled"
                 Title="Login">
    

    You put it in the first ContentPage tag on the first line of xaml. Duh!!!!!!!!