Kinnara / ModernWpf

Modern styles and controls for your WPF applications
MIT License
4.45k stars 446 forks source link

CommandBarFlyout sometimes disabled #569

Open deakjahn opened 1 year ago

deakjahn commented 1 year ago

I have the following flyout from a button:

<Button>
  <ui:SymbolIcon Symbol="More" />
  <ui:FlyoutService.Flyout>
    <ui:CommandBarFlyout Placement="Right">
      <ui:AppBarButton Label="Edit" Icon="Edit" Command="{StaticResource DoEdit}" />
      <ui:AppBarButton Label="New" Icon="Add" Command="{StaticResource DoNew}" />
      <ui:AppBarButton Label="Delete" Icon="Delete" Command="{StaticResource DoDelete}" Foreground="Crimson" />
      <ui:CommandBarFlyout.SecondaryCommands>
        <ui:AppBarButton Label="Download" Icon="Download" Command="{StaticResource DoDownloadWeb}" />
        <ui:AppBarButton Label="Download URL" Icon="Globe" Command="{StaticResource DoDownloadUrl}" />
      </ui:CommandBarFlyout.SecondaryCommands>
    </ui:CommandBarFlyout>
  </ui:FlyoutService.Flyout>
</Button>

When I click on the button, the flyout opens but is disabled -- from time to times. Sometimes it's enabled. Sometimes it gets enabled for a moment when I click the button to close -- just before closing, the items get the non-disabled colors. No rhyme or reason to it, it works about half of the time. The commands are available, they are not conditional.

My app is .NET 6,0, running on 11.