WPF实现DoEvents
WPF实现DoEvents
- static void DoEvents()
- {
- DispatcherFrame frame = new DispatcherFrame(true);
- Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, (SendOrPostCallback)delegate(object arg)
- {
- DispatcherFrame fr = arg as DispatcherFrame;
- fr.Continue = false;
- }, frame);
- Dispatcher.PushFrame(frame);
- }
调用:
DoEvents();
本文来自博客园,作者:willamyao,转载请注明原文链接:https://www.cnblogs.com/robertyao/p/8031876.html
代码改变世界