How can I implement a countdown timer in my Windows Phone 8.1 app? There seems to be no information available for it. All I could find works for either a Windows Forms application or a Windows Application, but none of them seems to be working on the phone app.This is what I am doing-
namespace Timer
{
public partial class MainPage : Page
{
DispatcherTimer mytimer = new DispatcherTimer();
int currentcount = 0;
public MainPage()
{
InitializeComponent();
mytimer = new DispatcherTimer();
mytimer.Interval = new TimeSpan(0, 0, 0, 1, 0);
mytimer.Tick += new EventHandler(mytime_Tick);
//HERE error comes Cannot implicitly convert type System.EventHandler to System.EventHandler<object>
}
private void mytime_Tick(object sender,EventArgs e)
{
timedisplayBlock.Text = currentcount++.ToString();
}
private void startButton_Click(object sender, RoutedEventArgs e)
{
mytimer.Start();
}
}
}
But it gives me this error-
Cannot implicitly convert type System.EventHandler to System.EventHandler<object>