有没有一种方法可以在 WPF 应用程序中进行空闲时间处理,相当于 MFC 中的 OnIdle 事件?
最佳答案
您可以使用 Dispatcher
分派(dispatch)任务(以正常方式使用 DispatcherPriority
) ApplicationIdle
,只有在应用程序空闲时才会执行。示例代码:
DispatcherPriority priority = DispatcherPriority.ApplicationIdle;
Application.Current.Dispatcher.BeginInvoke(priority, action);
关于c# - 我们如何在 WPF 应用程序中进行空闲时间处理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3872992/