How do I make an eventhandler run asynchronously?
I am writing a Visual C# program that executes a continuous loop of operations on a secondary thread. Occasionally when that thread finishes a task I want it to trigger an eventhandler. My program does that but the when the event handler is triggered, the secondary thread waits until the event handler is finished before continuing the thread. How do I make it continue? Here is the way I currently have it structured... class TestClass { private Thread SecondaryThread; public event EventHandler OperationFinished; public void StartMethod() { ... SecondaryThread.Start(); //start the secondary