-
-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Disable button when Command can't execute #2067
Comments
Can you explain better? To tell you the truth I'm not that familiar with IComand. The protected async Task ClickHandler()
{
if ( !Disabled )
{
await Clicked.InvokeAsync( null );
if ( Command?.CanExecute( CommandParameter ) ?? false )
{
Command.Execute( CommandParameter );
}
}
} |
I will have a look if I can make a PR for this. Mainly what should happen is that when you set the This is also how a Wpf button works. |
Hello, |
I don't really understand your question, but when you don't assign a command the behavior stays exactly the same as it is now. When you assign a command you will get the expected MVVM behavior as is with Wpf and frameworks like ReactiveUI |
Well thanks for the explanation. |
When you assign a
Command
to aButton
it would be nice if theDisabled
property of theButton
would listen to theICommand.CanExecute(parameter)
and theICommand.CanExecuteChanged
event.The text was updated successfully, but these errors were encountered: