Fixed stuck in Invoke.

This commit is contained in:
soukoku
2014-04-14 19:30:25 -04:00
parent 320dfb2175
commit d8512f7706
3 changed files with 200 additions and 84 deletions

View File

@@ -50,7 +50,17 @@ namespace Tester.WPF
{
Messenger.Default.Register<DialogMessage>(this, msg =>
{
ModernMessageBox.Show(this, msg.Content, msg.Caption, msg.Button, msg.Icon, msg.DefaultResult);
if (Dispatcher.CheckAccess())
{
ModernMessageBox.Show(this, msg.Content, msg.Caption, msg.Button, msg.Icon, msg.DefaultResult);
}
else
{
Dispatcher.BeginInvoke(new Action(() =>
{
ModernMessageBox.Show(this, msg.Content, msg.Caption, msg.Button, msg.Icon, msg.DefaultResult);
}));
}
});
}
}