Please, explain the difference between \"DispatcherTimer\" and \"a regular Timer\" that @Kent Boogaart meant for using in a multithreading WPF app as a task sheduler in this
With .NET 4.5 you can also create an async
delegate for your timer if you need to use the new .NET 4.5 await
functionality.
var timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(20);
timer.Tick += new EventHandler(async (object s, EventArgs a) =>
{
Message = "Updating...";
await UpdateSystemStatus(false);
Message = "Last updated " + DateTime.Now;
});
timer.Start();