Skip to main content

ICommandSource Interface

Definition

Namespace:Avalonia.Input
Assembly:Avalonia.Base
Package:Avalonia

An interface for classes that know how to invoke a Command.

public interface ICommandSource

Methods

NameDescription
CanExecuteChangedCalled for the CanExecuteChanged event when changes are detected.

CanExecuteChanged Method

Called for the CanExecuteChanged event when changes are detected.

public void CanExecuteChanged(object sender, EventArgs e)

Parameters

sender object

The event sender.

e EventArgs

The event args.

Properties

NameDescription
CommandThe command that will be executed when the class is "invoked." Classes that implement this interface should enable or disable based on the command's CanExecute return value. The property may be implemented as read-write if desired.
CommandParameterThe parameter that will be passed to the command when executing the command. The property may be implemented as read-write if desired.
IsEffectivelyEnabledGets a value indicating whether this control and all its parents are enabled.

Command Property

The command that will be executed when the class is "invoked." Classes that implement this interface should enable or disable based on the command's CanExecute return value. The property may be implemented as read-write if desired.

public System.Windows.Input.ICommand Command { get; set; }

CommandParameter Property

The parameter that will be passed to the command when executing the command. The property may be implemented as read-write if desired.

public object CommandParameter { get; set; }

IsEffectivelyEnabled Property

Gets a value indicating whether this control and all its parents are enabled.

public bool IsEffectivelyEnabled { get; set; }