Share via


XamlUICommand.CanExecuteChanged Event

Definition

Occurs whenever something happens that affects whether the command can execute.

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

Event Type

Implements

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

Remarks

Call CanExecute on the command element when this event occurs.

A command element typically disables itself if the command it is associated with cannot execute. For example, a MenuItem associated with the Paste command is disabled when the there is nothing on the clipboard to paste.

Applies to

See also