ThreadPool.QueueUserWorkItem(delegate
{
SynchronizationContext.SetSynchronizationContext(new
System.Windows.Threading.DispatcherSynchronizationContext(Application.Current.Dispatcher));
SynchronizationContext.Current.Post(pl =>
{
//这里写要执行的代码
}, null);
});
复制粘贴能跑就行