Compartir a través de


ICommand.CanExecuteChanged Evento

Definición

Se produce cada vez que ocurre algo que afecta a si el comando se puede ejecutar.

// 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) 

Tipo de evento

Comentarios

Llame a CanExecute en el elemento command cuando se produzca este evento.

Normalmente, un elemento de comando se deshabilita si el comando al que está asociado no se puede ejecutar. Por ejemplo, un objeto MenuItem asociado al comando Paste está deshabilitado cuando no hay nada en el Portapapeles que se va a pegar.

Se aplica a

Consulte también