c# - Invoke calls involving WPF controls hosted with WinForm forms never return -


i have windows forms program hosts several wpf controls. test execution tool. have come across issue invoke calls never return. happening 1 of tests plans written 1 of our users.

the problem happens @ different invokes throughout program. 2 examples:

winform.invoke(new action(() => wpfcontrol.datacontext = something)); application.current.dispatcher.invoke(new action(() => result.container.clear())); 

the thread calling invoke never returns invoke. expected there deadlock gui thread, gui thread executing fine. interestingly, winform controls behaving normally, no wpf controls respond user. none of other worker threads seem blocked.

two questions come mind:

  1. does have debugging suggestions?
  2. why wpf controls blocked winform controls work fine?

edit: should have mentioned may race condition of sort. seen infrequently , after application has been working while.

i don't know going on, have little information here go on. should either dotpeek or reflector, , put breakpoint in wpf internal "loop", , see why not updating / why not called.

the powerful technique in debugging debug internal code. interesting see happens if use snoop tool.

invoke very recipe dead locks. i've encountered myself deadlocks, i've seen others encounter it, etc.. if possible, see if can away begininvoke.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -