using System; using System.Threading; using System.Windows.Threading; namespace XHZB.Desktop.Utils { internal class ZDelayUtil { public static void delay(int sec, Dispatcher dispatcher, Action act) { new Thread(o => { Thread.Sleep(sec * 1000); dispatcher.Invoke(act); }).Start(); } } }