I have a WPF Application and inside hosted existing WinForms controls.
In WPF i'm using the 'Dispatcher' with the 'CheckAccess' method to check if invoke is required, in my old WinForms controls i use 'InvokeRequired'.
The problem is, that if one of the WinForms controls gets created but not yet shown (drawn) and the application gets to the line, where it has to invoke, the InvokeRequired property returns 'false' even the code is not running under the Main Thread and so
it resumes in a Cross-Thread exception.
The strange thing is, that it works fine, when the control gets visible (drawn) before changing it (in my case by switching to the specific tabpage).
For me it seems as if the 'InvokeRequired' property doesn't work reliable when the WinForms control gets hostet by WPF.
It would be great, if someone has experience with this issue and could help me!
View Complete Post