private static void StartProcessInBackground(ThreadStart processBackground, Loaded barModal) { Thread backgroundThread = new Thread(processBackground); backgroundThread.Start(); barModal.ShowDialog(); }