Computer Magic Logo
Timer

Tuesday, April 26, 2016

Published by Aristotelis Pitaridis

The code below changes the text of a Label every 1 second.

Device.StartTimer(TimeSpan.FromSeconds(1), () =>
{
    MyLabel.Text = DateTime.Now.ToString();
    return true;
});

We return the value true which means that we want the timer event to continue firing. If we want to stop the timer we return the false value.