I’m using a method which is called for 2 timers as their elapsed event handlers and also this method is called in the constructor of my class. The body of that method is mainly in
Dispatcher.Invoke(DispatcherPriority.Normal, (Action)(() =>
{ ... }));
I’m having some anomalies. What is better to use instead of a timer?
I’ve asked a couple of questions in the comment to the question, but to address:
If you want to do something periodically in the
Dispatcherthread, useDispatcherTimerinstead. Then you don’t need to marshal back to the UI thread, as the timer will “tick” in theDispatcherthread already.