Explorar o código

Fix occasional crash when editing settings file

Daniel Chalmers %!s(int64=2) %!d(string=hai) anos
pai
achega
7a2938da14
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      DesktopClock/MainWindow.xaml.cs

+ 1 - 1
DesktopClock/MainWindow.xaml.cs

@@ -45,7 +45,7 @@ public partial class MainWindow : Window
         _timeZone = App.GetTimeZone();
         UpdateIsCountdown();
 
-        Settings.Default.PropertyChanged += Settings_PropertyChanged;
+        Settings.Default.PropertyChanged += (s, e) => Dispatcher.Invoke(() => Settings_PropertyChanged(s, e));
 
         _systemClockTimer = new();
         _systemClockTimer.SecondChanged += SystemClockTimer_SecondChanged;