Using a Windows Forms dialog after an XNA game has exited

While working on the XNA Contest I wanted to use a standard Windows Forms dialog for credits at the end of the game, instead of doing it all inside XNA (mostly because it would have been much easier and faster to do). At the moment, when the game is over, this dialog appears:

My game's credits

The problem is that, as soon as the XNA window closes and the game terminates, the XNA framework tears down the entire thread on which it was running. If you try to open a Windows Forms dialog at that point, you will see a glimpse of it for some millisecond if you're lucky.  :)

The solution is a pretty simple workaround, but since I tried a lot of different things before and wasted some time, I thought this might by interesting to share: essentially, you run the whole XNA game in a different thread than your main thread. When XNA closes its window, it will tear down the other thread you created, leaving you with the main thread still running.

static void Main(string[] args) {

	Application.EnableVisualStyles();

	//Separate thread on which the game will run
	Thread backThread = new Thread(new ThreadStart(delegate() {
		using (Main game = new Main()) {
			game.Run();
		}
	}));

	backThread.Start();

	//Wait for the game to end
	backThread.Join();

	//Credits dialog
	using (Credits c = new Credits()) {
		c.ShowDialog();
	}
}