Skip to content

CommandRouter.ExecuteAsync method (1 of 3)

Executes the command in the current focused context; returns false when no handler exists or CanExecute rejects the invocation.

public ValueTask<bool> ExecuteAsync(Command command, Element? source = null,
CancellationToken cancellationToken = default)

CommandRouter.ExecuteAsync method (2 of 3)

Section titled “CommandRouter.ExecuteAsync method (2 of 3)”

Executes the command for the given target; returns false when no handler exists or CanExecute rejects the invocation.

public ValueTask<bool> ExecuteAsync(Command command, CommandTarget target, Element? source = null,
CancellationToken cancellationToken = default)

CommandRouter.ExecuteAsync method (3 of 3)

Section titled “CommandRouter.ExecuteAsync method (3 of 3)”

Executes the command for the given target with a given operand (a menu item’s CommandData) instead of one resolved from the target; returns false when no handler exists or CanExecute rejects the invocation.

public ValueTask<bool> ExecuteAsync(Command command, CommandTarget target, object? argument,
Element? source, CancellationToken cancellationToken = default)