Skythrust
Member
- Jul 9, 2019
- 133
- 7
Hi there!
I was wondering if xaml does have an option to have a timer. For example to update the current (real) time every 5 seconds)
I have tried this code below but without success.
I was wondering if xaml does have an option to have a timer. For example to update the current (real) time every 5 seconds)
I have tried this code below but without success.
C#:
public void UpdateValues()
{
System.Timers.Timer tValueUpdater = new System.Timers.Timer();
tValueUpdater.Interval = 500;
tValueUpdater.Elapsed += OnTimedEvent;
tValueUpdater.Enabled = true;
}
private void OnTimedEvent(object sender, System.Timers.ElapsedEventArgs e)
{
resc.GetLiveTemperature();
resc.GetValues();
AppDesigner();
lHeaderFooter.Text = DateTime.Now.ToString();
}