Ok thanks. How do I do that?After the call to the DispatcherTimer constructor, start typing this: timer.Tick +=
Visual Studio should prompt you about pressing TAB for auto-generating a Tick handler. Press tab twice to have Visual Studio create the handler. You should end up with this:
public MainPage() |
{ |
InitializeComponent(); |
DispatcherTimer timer = new DispatcherTimer(); |
timer.Tick += new EventHandler(timer_Tick); |
timer.Interval = new TimeSpan(0, 0, 1); |
timer.Start(); |
} |
void timer_Tick(object sender, EventArgs e) |
{ |
throw new NotImplementedException(); |
} |
Replace the throw statement with the code you want to run.
Richard Woo