How can I report a string (like "now searching file. . .", "found selection. . .") back to my windows.form from a backgroundWorker as well as a percentage. Additionally, I have a large class that contains the method I want to run in the backgroundWorker_Work. I can call it by Class_method(); but i am then unable to report my percentage done or anything from the called class, only from the backgroundWorker_Work method.
Thanks!
You can use the userState parameter of
ReportProgress
method to report that strings.Here's an example from MSDN:
Read Simple Multi-threading in Windows Forms.
It's a 3-part series.
use a delegate.
I'm assuming WCF also have the method
So just use the userState to report the string.
And you'll get that "Initiating countdown" string back in ProgressChanged event