Implement Model/Dialog Form using Windows Form?
we have this application which uses cross app domain (2 app domains in the same process).
we need to mimic the Dialog/Model window, which will wait for the result from the 2nd app domain before it can continue further. 2nd App Domain loads up WPF form (while 1st app domain is still on .Net 2 forms). we will have to use this Plugins approach so that we can leverage our new WPF without breaking our old app.
at the moment I am using ManualEventReset to singal when the 2nd app domain is done, but this is freezing up the GUI so that when I move the Dialog/Model window, it is not repainting the backg开发者_运维百科round. Only happens on Windows XP (Windows 7 works fine)
I was wondering if there is a way to implement Model window so that it will still allow messages to go through so that background can repaint itself. Let me know if you need more specifics
you could open a regular modal form, that immediately hides itself and open the desired winforms form on another thread ... so you can "deadlock" one thread until your operation is complete without blocking the message processing of your UI ... to exit the modal state after your locked thread is released, invoke your hidden forms close() (Invoke() call to your UI thread)
精彩评论