Background timer to update UI?
You need two things for it:
Timer
You can update the UI in
System.Timers.Timer
with the 10 seconds interval.Dispatcher
You need to use
Dispatcher.Invoke
to change the UI without holding the main UI thread. Instead the methodProcess
should be called on a separate thread (Timer
method), other than main UI thread, and useDispatcher
in it to alert main UI thread for the change.Process() // method to be called after regular interval in Timer { // lengthy process, i.e. data fetching and processing etc. // here comes the UI update part Dispatcher.Invoke((Action)delegate() { /* update UI */ }); }