NotifyCanExecuteChanged event doesn't set correct button color on Windows
Description
The CanExecute functionality is supposed to enable and disable buttons, but on Windows it doesn't work as expected.
Works fine on Android.
Steps to Reproduce
-
Run the minimal example
-
Add record.
-
Clear the records.
-
Add another record.
The clear button is not visibly enabled the second time, although the button is actually enabled.
Link to public reproduction project repository
https://github.com/symbiogenesis/WindowsCanExecute
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
I see it with net7.0-windows10.0.22621.0
Did you find any workaround?
No
Relevant log output
No response
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
I had the same issue and I found that using await Task.Delay(25) in the pressed event/command before changing the bound property made it work. If I had to guess, it has something to do with the change in style occurring simultaneously with the click event. Hope this works for you!
This might be a duplicate issue. See https://github.com/dotnet/maui/issues/9753. I can confirm this is a bug that exists when targeting Windows. I verified using Visual Studio 17.4.3.
This is a duplicate of #9753 on Windows, and is fixed by #11840, which will be included in an upcoming service release.