I am looking at the code from here
/// <summary>
/// Returns the command that, when invoked, attempts
/// to remove this workspace from the user interface.
/// </summary>
public ICommand CloseCommand
{
get
{
if (_closeCommand == null)
_closeCommand = new RelayCommand(param => this.OnRequestClose());
return _closeCommand;
}
}
what does param in param => this.OnRequestClose() refer to?
RelayCommandis presumably a delegate-type that accepts a single parameter, or a type that itself takes such a delegate-type in the constructor. You are declaring an anonymous method, saying simply “when invoked, we’ll take the incoming value (but then not use it), and callOnRequestClose. You could also have (maybe clearer):It is probably clearer in other uses where it is used, for example:
where the lambda is “given an
item, obtain theitem‘sSomeValue“. In your case the lambda is “givenparam, ignoreparamand callOnRequestClose()“