How to disable .Net MAUI menuitem

CFos 41 Reputation points
2022-10-17T19:31:59.73+00:00

Hi,

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.

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

Thanks for any help!

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