How to disable .Net MAUI menuitem

CFos 41 Reputation points


I am trying to disable a menuitem in a .Net MAUI app (for Windows currently) but can't seem to do that. I tried the "IsEnabled" property but it seems to be a read-only one. Does anyone know how to do this? Below is example XAML code. I specifically wanted to disable the "MenuFlyoutItem" below.

        <MenuBarItem Text="Connection" BindingContext="{Binding Path=BindingContext, Source={x:Reference TopShell}}" >  
            <MenuFlyoutItem Text="Disconnect" Command="{Binding DisconnectCMD}" />  

Thanks for any help!

A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,960 questions
{count} votes