dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.04k stars 1.73k forks source link

MenuItem command stays disabled after remove-readd even if the canExecute is true #22544

Open inimirpaz opened 4 months ago

inimirpaz commented 4 months ago

Description

Both by using the standard Microsoft.Maui.Controls.Command and the AsyncCommand (by James Montemagno), whenever I specify the canExecute condition, after the ToolbarItem is removed-then-readded it is disabled regardless of the canExecute being set to true. (it was not the case with Xamarin.Forms)

Related to: https://github.com/dotnet/maui/issues/21976

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/inimirpaz/maui_issues/tree/issue_with_enabled

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 4 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

inimirpaz commented 3 months ago

Has this been verified by the team?