用于WPF的Application.DoEvents(),调用方法,直接调用DoEvents();

用于WPF的Application.DoEvents(),调用方法,直接调用DoEvents();

 1 static void DoEvents()
 2 {
 3 DispatcherFrame frame = new DispatcherFrame(true);
 4 Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, (SendOrPostCallback)delegate (object arg)
 5 {
 6 DispatcherFrame fr = arg as DispatcherFrame;
 7 fr.Continue = false;
 8 }, frame);
 9 Dispatcher.PushFrame(frame);
10 }

 

posted on 2016-12-20 17:06  jmlsaul  阅读(467)  评论(0)    收藏  举报