Browse Source

Add interface ICommandSource

pull/4737/head
Giuseppe Lippolis 6 years ago
parent
commit
640bddf5ca
  1. 31
      src/Avalonia.Input/ICommandSource.cs

31
src/Avalonia.Input/ICommandSource.cs

@ -0,0 +1,31 @@
using System.Windows.Input;
namespace Avalonia.Input
{
///<summary>
/// An interface for classes that know how to invoke a Command.
///</summary>
public interface ICommandSource
{
/// <summary>
/// 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.
/// </summary>
ICommand Command { get; }
/// <summary>
/// The parameter that will be passed to the command when executing the command.
/// The property may be implemented as read-write if desired.
/// </summary>
object CommandParameter { get; }
/// <summary>
/// Bor the bheavior CanExecuteChanged
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void CanExecuteChanged(object sender, System.EventArgs e);
}
}
Loading…
Cancel
Save