ICommand.CanExecuteChanged Événement

Définition

Se produit chaque fois que quelque chose se produit qui affecte si la commande peut s’exécuter.

// Register
event_token CanExecuteChanged(EventHandler<IInspectable> const& handler) const;

// Revoke with event_token
void CanExecuteChanged(event_token const* cookie) const;

// Revoke with event_revoker
ICommand::CanExecuteChanged_revoker CanExecuteChanged(auto_revoke_t, EventHandler<IInspectable> const& handler) const;
event System.EventHandler<object> CanExecuteChanged;
function onCanExecuteChanged(eventArgs) { /* Your code */ }
iCommand.addEventListener("canexecutechanged", onCanExecuteChanged);
iCommand.removeEventListener("canexecutechanged", onCanExecuteChanged);
- or -
iCommand.oncanexecutechanged = onCanExecuteChanged;
Event CanExecuteChanged As EventHandler(Of Object) 

Type d'événement

Remarques

Appelez CanExecute sur l’élément command lorsque cet événement se produit.

Un élément de commande se désactive généralement si la commande à laquelle il est associé ne peut pas s’exécuter. Par exemple, un MenuItem associé à la commande Coller est désactivé lorsque le n’a rien à coller dans le Presse-papiers.

S’applique à

Voir aussi