public interface ICommand
public Button(ICommand command)
public class CustomerService
public void AddCustomer()
Console.WriteLine("Add Customer");
public class AddCustomerCommand: ICommand
private CustomerService service;
public AddCustomerCommand(CustomerService service)
public static void Main()
var service = new CustomerService();
var command = new AddCustomerCommand(service);
var button = new Button(command);