我已经创造了新的WPF项目,在主窗口中我做:Dispatcher.Invoke挂起主窗口
public MainWindow()
{
InitializeComponent();
Thread Worker = new Thread(delegate(){
this.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action(delegate
{
while (true)
{
System.Windows.MessageBox.Show("asd");
Thread.Sleep(5000);
}
}));
});
Worker.Start();
}
问题之间的那些邮件主窗口挂起。我如何使它异步工作?
线程还应该将IsBackground设置为true,以便它将与应用程序 – 2013-04-30 11:24:24
一起退出非常感谢。 – Taras 2013-04-30 11:26:40