This repository has been archived by the owner on Sep 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 310
Could anyone suggest a neat way to Dis-/Enable buttons #83
Comments
ICommand and RelayCommand have a Func<bool> canExecute as well as an Action execute. When a button binds to an ICommand the enabled state binds to CanExecute and is updated on the CanExecuteChanged event. See the MVVM light sample RaiseCanExecuteChanged Sample |
IMHO, this is quite bad example on how this works. Also I couldn't open this sample with VS2015. |
@DeputyOfCopyPaster from your example it looks like you are trying to disable access while an async action is in process. If that is the case what you are doing is perfectly fine. Here is an example using ICommand that does not allow concurrent execution. XAML
CODE
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello everyone,
could anyone suggest a neat way to dis-/enable buttons?
Currently I'm doing such things as follows:
ViewModel:
The text was updated successfully, but these errors were encountered: