博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WPF界面刷新
阅读量:2430 次
发布时间:2019-05-10

本文共 1665 字,大约阅读时间需要 5 分钟。

///     /// Designates a Windows Presentation Foundation application model with added functionalities.    ///      public class UIHelper : CLeopardTestWPF    {        private static DispatcherOperationCallback exitFrameCallback = new DispatcherOperationCallback(ExitFrame);        ///         /// Processes all UI messages currently in the message queue.        ///         public static void DoEvents()        {            // Create new nested message pump.            DispatcherFrame nestedFrame = new DispatcherFrame();            // Dispatch a callback to the current message queue, when getting called,             // this callback will end the nested message loop.            // note that the priority of this callback should be lower than the that of UI event messages.            DispatcherOperation exitOperation = Dispatcher.CurrentDispatcher.BeginInvoke(                DispatcherPriority.Background, exitFrameCallback, nestedFrame);            // pump the nested message loop, the nested message loop will             // immediately process the messages left inside the message queue.            Dispatcher.PushFrame(nestedFrame);            // If the "exitFrame" callback doesn't get finished, Abort it.            if (exitOperation.Status != DispatcherOperationStatus.Completed)            {                exitOperation.Abort();            }        }        private static Object ExitFrame(Object state)        {            DispatcherFrame frame = state as DispatcherFrame;            // Exit the nested message loop.            if (frame != null)            {                frame.Continue = false;            }            return null;        }    }

转载地址:http://stnmb.baihongyu.com/

你可能感兴趣的文章
打造金融科技银行,招行的底气源自……
查看>>
火爆全网的动态曲线图是怎么做的?
查看>>
程序员感叹一年只能存下15万太少了……网友:潸然泪下
查看>>
文科出身敲出 Instagram,被小札“挤”走,建新冠追踪网站,这个程序员有点牛!...
查看>>
面对 Python,Java 中枪了 | 每日趣闻
查看>>
地方普通院校的计算机专业「科班」学生如何突围而出?| 原力计划
查看>>
小白也能看懂的 Java 异常处理
查看>>
C++ 是如何从代码到游戏的?
查看>>
程序员惊魂 12 小时:“���”引发线上事故
查看>>
调查了 10,975 位 Go 语言开发者,我们有了这些发现!
查看>>
面试官吐槽:“Python程序员就是不行!”网友:我能把你面哭!
查看>>
太真实!深刻解读论文里的话术| 每日趣闻
查看>>
拿来就能用!Python 每天定时发送一句情话 | 原力计划
查看>>
Java“拍了拍”你,面试其实没那么难...
查看>>
帅爆了!3个月0基础转型头条数据分析师,他做对了什么?
查看>>
程序员:我受够了!不想再在小厂里干Java了!
查看>>
厉害!国内大学生计算机编程第一人,一人挑战一个队,百度最年轻 T10,现创业自动驾驶...
查看>>
研发团队来了高颜值的妹子,这结局万万没想到 | 每日趣闻
查看>>
太难了!开源项目如何商业化?
查看>>
谷歌排名第一的编程语言,死磕它这两点,小白也能学的会!不信你看!
查看>>