Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
Problem with XamDockManager/DocumentContentHost on application with Multiple UI threads
posted

I have an application with 2 UI threads.


The Main UI thread has a Main window with a XamDockManager and a DocumentContentHost Control which contains a Pane.
The second UI thread opens a Window with a ListBox, and starts a timer that inserts an item on ListBox every second.

When the main window pane's close button is clicked, a MessageBox is displayed in the RequestBeforeClose handler.

The problem appears when the second thread's window get focused while the main thread's MessageBox is displayed.

NOTE: If I show the MessageBox in other point of main thread  there is not any problem, the problem seems appear when the MessageBox is shown from RequestBeforeClose handler.

The second thread gets suspended and every DispatcherOperationCallbacks (ListBox insertions) get queued until main thread's MessageBox is closed

I Attach a C# solution that reproduces this problem.

Any ideas how to fix this?

Thanks.

MultiUIThreads_Test.zip
Parents Reply Children