private void ShowMessageAsync() { this.messageThread = new Thread(new ThreadStart(() => { MessageBoxTestHelper helper = new MessageBoxTestHelper(); helper.ShowMessageBox(); Dispatcher.Run(); })); this.messageThread.SetApartmentState(ApartmentState.STA); this.messageThread.Start(); }
private Thread CreateMessageBoxOnSeparateThread() { Thread t = new Thread(new ThreadStart(() => { this.messageBoxTestHelperInstance = new MessageBoxTestHelper(); this.messageBoxTestHelperInstance.ShowMessageBox(); Dispatcher.Run(); })); t.SetApartmentState(ApartmentState.STA); return(t); }