我在主窗口中创建了新的 WPF 项目:
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();
}
问题在于 MainWindow 挂起的这些消息之间。如何让它异步工作?