Share via


XamlUICommand.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
XamlUICommand::CanExecuteChanged_revoker CanExecuteChanged(auto_revoke_t, EventHandler<IInspectable> const& handler) const;
// This member is not implemented in C#
function onCanExecuteChanged(eventArgs) { /* Your code */ }
xamlUICommand.addEventListener("canexecutechanged", onCanExecuteChanged);
xamlUICommand.removeEventListener("canexecutechanged", onCanExecuteChanged);
- or -
xamlUICommand.oncanexecutechanged = onCanExecuteChanged;
' This member is not implemented in VB.NET

Type d'événement

Implémente

E:Windows.UI.Xaml.Input.ICommand.CanExecuteChanged E:System.Windows.Input.ICommand.CanExecuteChanged

Remarques

Appelez CanExecute sur l’élément de commande 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