用于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 }
浙公网安备 33010602011771号