The Action<Object> delegate is used in RelayCommands, DelegateCommands.
Code snippets below:
public class SimpleDelegateCommand : ICommand
public SimpleDelegateCommand(Action<object> actionDelegate)
_executeDelegate = actionDelegate;
public class Methods
// A method that doesn't had any parameters
public static void NoParameterMethod()
MessageBox.Show("The Method that doesn't take a parameter was Called");
The question I have is: Why is the following acceptable?
private ICommand _test2Command = new SimpleDelegateCommand(y => Methods.NoParameterMethod());
given that the SimpleDelegateCommand needs and Action<object> delegate to be passed as an argument, how can a method that doesn't take any parameters be allowed by the delegate?