using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Threading; namespace FWindSoft.Wpf { /// /// 系统需求相关命令 /// public static class WpfSysCmd { public static void DoEvent() { DispatcherFrame frame = new DispatcherFrame(); Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new DispatcherOperationCallback(ExitFrame), frame); Dispatcher.PushFrame(frame); } private static object ExitFrame(object f) { ((DispatcherFrame)f).Continue = false; return null; } } }