Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Closed Issue: MessageBox kills Application.Current when hosted in WinForms [19076]

$
0
0
I'm using MessageBox from Extended WPF Toolkit in WPF component, which hosted in Windows Forms application via ElementHost. To share some resources, I'm using this approach:

if (Application.Current != null)
{
Logger.Debug(Resources.ComponentBootstrapper_SkippingSharedResources);
return;
}

Logger.Debug(Resources.ComponentBootstrapper_CreatingApplication);

new Application();

foreach (var uri in SharedResourceDictionaries)
{
AddSharedResourceDictionary(uri);
}

This code works fine until somewhere in the WPF component's code MessageBox will be shown. Then, Application.Current in the code above returns null, but new Application() raises an exception, which tells, that I can't create more that one instances of Application per domain.

If calls to MessageBox being replaced by calls to System.Windows.MessageBox, everything works fine.
Comments: by design

Viewing all articles
Browse latest Browse all 4964

Trending Articles



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