打开窗体
Window win;
Thread t=new Thread(()=>
{
win=new Window();
win.Show();
System.Windows.Threading.Dispatcher.Run();
});
t.IsBackground=true;
t.SetApartmentState(ApartmentState.STA);
t.start();
Thread t2=new Thread(()=>
{
Thread.Sleep(600);
});
t2.IsBackground=true;
t2.start();
t2.Join();
关闭
System.Windows.Threading.Dispatcher.ExitAllFrames();
备忘