I need to fire an event automatically every few minutes. I know I can do this using Timers.Elapsed event in Windows Forms applications as below.
using System.Timers;
namespace TimersDemo
{
public class Foo
{
System.Timers.Timer myTimer = new System.Timers.Timer();
public void StartTimers()
{
myTimer.Interval = 1;
myTimer.Elapsed += new System.Timers.ElapsedEventHandler(myTimer_Elapsed);
myTimer.Start();
}
void myTimer_Elapsed(object sender, EventArgs e)
{
myTimer.Stop();
//Execute your repeating task here
myTimer.Start();
}
}
}
I have googled a lot and struggling to find what is the equivalent of this in UWP.