Open beeradmoore opened 7 months ago
Can repro it at maccatalyst on the latest 17.6.10(build428)(8.0.14).
Just noticed an interesting thing that I'll see if I can add into the repro.
In my actual app I have a File > Import menu. Clicking Import opens a file browser. Closing that file browser left the File > Import menu disabled where it was previously enabled. I am also using RelayCommand from CommunityToolkit.MVVM over there. And my method is async/awaitable.
Initial thoughts there is that whatever is doing the Commanding and controlling CanExecute seems to update the IsEnabled correctly, but binding my own property with ObservableProperty isn't triggering the same thing.
Can confirm the same bug happens using a MenuFlyoutItem in a MenuFlyOut on MacCatalyst on Vesion 8.0.21.
<FlyoutBase.ContextFlyout>
<MenuFlyout x:DataType="entities:LogEntry">
<MenuFlyoutItem Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:LogEntriesViewModel}}, Path=PinLogEntryCommand}" CommandParameter="{Binding .}"
Text="{Binding IsPinned, Converter={StaticResource BoolToPinTextConverter}}" />
</MenuFlyout>
</FlyoutBase.ContextFlyout>
Description
When you have a
MenuBarItem
orFlyoutItem
and bind itsText
orIsEnabled
(probably more) and you toggle those values it does not update the menu itself after initial binding.In the sample repo I created any changes to
MenuBarItemText
,MenuFlyoutItemText
, andIsOddClicks
(by clicking the button on the page) does not get reflected in the UI when tested on macOS. This works as expected on Windows.I don't think this is a regression, this has been broken at least since 8.0.6, it may have never worked.
Example
macOS - see how clicks is 5 but the menu is not updated.
Windows:
Steps to Reproduce
string
value that can be binding to (I usedCommunityToolkit.MVVM
Link to public reproduction project repository
https://github.com/beeradmoore/maui-issue-MenuBarTextEnabledBindingIssue
Version with bug
8.0.14
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
macOS
Affected platform versions
macOS 14.4
Did you find any workaround?
Not yet
Relevant log output
No response