XamlUICommand.CanExecuteChanged Événement
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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
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
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de l’année 2024, nous abandonnerons progressivement le mécanisme de retour d’information GitHub Issues pour le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultez :Soumettre et afficher des commentaires pour