Share via


ICommand.CanExecuteChanged Evento

Definizione

Si verifica ogni volta che accade qualcosa che influisce sul fatto che il comando possa essere eseguito.

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

Commenti

Chiamare CanExecute nell'elemento di comando quando si verifica questo evento.

Un elemento di comando disabilita in genere se il comando associato a non può essere eseguito. Ad esempio, un Oggetto MenuItem associato al comando Incolla è disabilitato quando non è presente alcun elemento negli Appunti da incollare.

Si applica a

Vedi anche