我们如何在WPF应用程序执行空闲时间处理?应用程序、时间、如何在、WPF

2023-09-02 10:51:27 作者:试着放弃丶

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

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

推荐答案

您可以派遣任务(使用Dispatcher以正常的方式)与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.