I am trying to understand the meaning and use of the param parameter in this line taken from a RelayCommand example:
return new RelayCommand(param => MessageBox.Show("It worked."));
First, I understand that the "param" parameter has nothing to do with the "params" keyword, is this correct?
public int Add(params int[] list)
{
int sum = 0;
foreach (int i in list)
sum += i;
return sum;
}
Second, what kind of delegate code do I have to add to get the following example to work?
using System;
using System.Collections.Generic;
namespace TestParam222
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("The total is {0}.", Tools.GetTest(param => 23));
Console.ReadLine();
}
}
class Tools
{
public static string GetTest(List<int> integers)
{
return "ok";
}
}
}