I have a class that has an Action<string> called DisplayData;
In various points in the class I call DisplayData("Here's Data");
I have a Windows form with a method called AddToList(string Data);
I have a main entry point class that has reference to my class and form and I am trying to do this:
fmMain MainForm = new fmMain();
MainForm.AddToList= Logic.DisplayData;
The idea is that when I call DisplayData in the various places in that class the form will display the data.
I assume the form has to have a action rather than a method but I’m not entirely sure
You’re doing it the wrong way round. You should use:
(I’d also strongly suggest revisiting your names to follow .NET naming conventions, but that’s a separate matter.)