Chcę zmieniać co np 1s tekst w Lableu.
Tworzę:
private static System.Timers.Timer aTimer;
public MainWindow()
{
aTimer = new System.Timers.Timer(10000);
// Hook up the Elapsed event for the timer.
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
// Set the Interval to 2 seconds (2000 milliseconds).
aTimer.Interval = 0.5;
aTimer.Enabled = true;
}
public void OnTimedEvent(object source, ElapsedEventArgs e)
{
mojlabel.Content("OK");
}
Jednak nie chce to działać. Jak można to poprawić?