我们如何在WPF应用程序执行空闲时间处理? [英] How do we do idle time processing in WPF application?

查看:866
本文介绍了我们如何在WPF应用程序执行空闲时间处理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法做到的空闲时间处理在WPF相当于的OnIdle事件应用MFC?

Is there a way to do idle time processing in WPF application equivalent to OnIdle event in MFC?

推荐答案

您可以派遣任务(使用<一个href="http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcher.aspx"><$c$c>Dispatcher以正常的方式)与<一href="http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcherpriority.aspx"><$c$c>DispatcherPriority ApplicationIdle ,当应用程序处于空闲状态,这将只被执行。

You can dispatch a task (using the Dispatcher in the normal way) with a DispatcherPriority of ApplicationIdle, which will only be executed when the application is idle.

这篇关于我们如何在WPF应用程序执行空闲时间处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆