From f84db654c7c5192b244cece5ff12f1ae98d29592 Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Tue, 13 May 2014 17:36:56 -0400 Subject: [PATCH] Use more direct control of the timer --- Window/WindowSource.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Window/WindowSource.cs b/Window/WindowSource.cs index 79bcb8a..6a2d500 100644 --- a/Window/WindowSource.cs +++ b/Window/WindowSource.cs @@ -21,7 +21,7 @@ namespace SystemTemperatureStatusWindow _floatingStatusWindow = new FloatingStatusWindow(this); _floatingStatusWindow.SetText(Resources.Loading); - _refreshTimer = new Timer(Settings.Default.UpdateInterval); + _refreshTimer = new Timer(Settings.Default.UpdateInterval) { AutoReset = false }; _refreshTimer.Elapsed += HandleTimerElapsed; _refreshTimer.Start(); } @@ -109,7 +109,9 @@ namespace SystemTemperatureStatusWindow private void UpdateText(string text) { - _dispatcher.InvokeAsync(() => _floatingStatusWindow.SetText(text)); + _dispatcher.Invoke(() => _floatingStatusWindow.SetText(text)); + + _refreshTimer.Start(); } public string Name