Closed Blener closed 3 years ago
@Blener Hi. Thanks for the report, but it's the default behavior of Xamarin.Forms.
A command comes with its own CanExecute
property that overrides IsEnabled
. If not explicitly set through commandCanExecute
, it will default to true
so the button will always be active regardless of isEnabled
.
So when using commands in Fabulous, use commandCanExecute
to switch between enable and disable instead of IsEnabled
.
View.Button(text = "Disabled with command", command = ignore, commandCanExecute = false)
Hi @TimLariviere . My mistake then, sorry for that. Thank you for the help.
When a button has the command property set it doesn't get disabled.
The code above generates this:![image](https://user-images.githubusercontent.com/7217205/99327236-3ec0fc00-2858-11eb-9437-aaf81cf1edec.png)
This was using Fabulous 0.57.0 on an Android emulator.
Thanks.