Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: MessageBox only opens once

$
0
0
I resolved it. It seems to be related to the fact that my main window is winforms and the rest hosted with elementhost. I noticed that it was not just your messagebox that had a problem opening more than once, it was other wpf windows opened from a hosted usercontrol also. The solution HERE solved it.

Basically you need to put the below code for the mainform Load event.
if (System.Windows.Application.Current == null) 
{ 
    new System.Windows.Application { ShutdownMode = ShutdownMode.OnExplicitShutdown }; 
}
And then for the in the ForClosed event
Application.Current.Shutdown()

Viewing all articles
Browse latest Browse all 2157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>