public bool?ShowDialog(string caption, string message) { bool?result = null; UIThread(() => { result = new Windows.Modal(message, caption).ShowDialog(mainWindow); }); return(result); }
public object Show(ViewModel.BaseViewModel vm) { Windows.Modal wnd = new Windows.Modal(); wnd.ContentRendered += Wnd_ContentRendered; wnd.DataContext = vm; // Flush the dispatcher queue //wnd.Dispatcher.Invoke(DispatcherPriority.Send, new System.Action(() => { })); wnd.Show(); frame = new DispatcherFrame(true); frame.Continue = true; Dispatcher.PushFrame(frame); _renderComplete.WaitOne(); _renderComplete.Reset(); wnd.DataContext = null; wnd.Close(); frame.Continue = false; return(vm); }