Compartilhar via


XamlUICommand.CanExecuteChanged Evento

Definição

Ocorre sempre que algo acontece que afeta se o comando pode ser executado.

// 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;
public event System.EventHandler<object> CanExecuteChanged;
function onCanExecuteChanged(eventArgs) { /* Your code */ }
xamlUICommand.addEventListener("canexecutechanged", onCanExecuteChanged);
xamlUICommand.removeEventListener("canexecutechanged", onCanExecuteChanged);
- or -
xamlUICommand.oncanexecutechanged = onCanExecuteChanged;
Public Custom Event CanExecuteChanged As EventHandler(Of Object) Implements CanExecuteChanged

Tipo de evento

Implementações

Comentários

Chame CanExecute no elemento de comando quando esse evento ocorrer.

Um elemento de comando normalmente se desabilita se o comando ao qual ele está associado não puder ser executado. Por exemplo, um MenuItem associado ao Paste comando é desabilitado quando não há nada na área de transferência para colar.

Aplica-se a

Confira também