From 640bddf5cabf5f6a8bf4cb07fefe341549c62c03 Mon Sep 17 00:00:00 2001 From: Giuseppe Lippolis Date: Thu, 24 Sep 2020 14:59:29 +0200 Subject: [PATCH] Add interface ICommandSource --- src/Avalonia.Input/ICommandSource.cs | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/Avalonia.Input/ICommandSource.cs diff --git a/src/Avalonia.Input/ICommandSource.cs b/src/Avalonia.Input/ICommandSource.cs new file mode 100644 index 0000000000..b0dd75e12e --- /dev/null +++ b/src/Avalonia.Input/ICommandSource.cs @@ -0,0 +1,31 @@ +using System.Windows.Input; + +namespace Avalonia.Input +{ + /// + /// An interface for classes that know how to invoke a Command. + /// + public interface ICommandSource + { + /// + /// 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. + /// + ICommand Command { get; } + + /// + /// The parameter that will be passed to the command when executing the command. + /// The property may be implemented as read-write if desired. + /// + object CommandParameter { get; } + + + /// + /// Bor the bheavior CanExecuteChanged + /// + /// + /// + void CanExecuteChanged(object sender, System.EventArgs e); + } +}