public virtual bool? ShowDialogModal(DialogControlContainer container)
{
ShowDialog(container);
while (_isOpen)
{
// from http://www.codeproject.com/Articles/36516/WPF-Modal-Dialog
// HACK: Stop the thread if the application is about to close
if (this.Dispatcher.HasShutdownStarted ||
this.Dispatcher.HasShutdownFinished)
{
break;
}
// HACK: Simulate "DoEvents"
//this.Dispatcher.Invoke(DispatcherPriority.Background, new ThreadStart(delegate { }));
this.Dispatcher.DoEvents();
Thread.Sleep(20);
}
return DialogResult;
}