Is there a way to do idle time processing in WPF application equivalent to OnIdle event in MFC?
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. Sample code:
DispatcherPriority priority = DispatcherPriority.ApplicationIdle;
Application.Current.Dispatcher.BeginInvoke(priority, action);
It is the Dispatcher.Hooks.DispatcherInactive event.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With