I have async operation, in which I call a non-void method:
var result = _controller.SendInvoice(this.ParentForm);
I was getting error "Cross-thread operation not valid: Control 'ParentForm' accessed from a thread other than the thread it was created on"
I've managed to fix it by writing code like this:
ParentForm.Invoke(new MethodInvoker(delegate { _controller.SendInvoice(ParentForm); }));
The problem is that I have to get the return result of the method SendInvoice, but the "solution" above does not solving it for me because it doesn't return value from SendInvoice() method.