private static void StartDialog() { var threadObj = new Thread(() => { var application = new TestApplication(); application.Run(); }); threadObj.SetApartmentState(ApartmentState.STA); threadObj.Start(); threadObj.Join(); }