Say we have a main class and another class with some custom events called OnFoo .
Now the second class has a separate thread, which should trigger these events, to which the main thread should be connected. But as soon as these events arise, the main class tries to do something on its own, which is impossible, since the function of raising the event actually remains in this second thread.
How to raise OnFoo so that the main class can change the properties of itself when an event occurs?
PS: I read about Invoke and BeginInvoke, but had no success with them.
source share