diff --git a/DesktopEdge/MainWindow.xaml.cs b/DesktopEdge/MainWindow.xaml.cs index 232c444c..d95d0233 100644 --- a/DesktopEdge/MainWindow.xaml.cs +++ b/DesktopEdge/MainWindow.xaml.cs @@ -393,15 +393,17 @@ namespace ZitiDesktopEdge { bool startZitiButtonVisible = false; private void ShowServiceNotStarted() { - semaphoreSlim.Wait(); //make sure the event is only added to the button once - CloseErrorButton.Click -= CloseError; - if (!startZitiButtonVisible) { - CloseErrorButton.Content = "Start Service"; - startZitiButtonVisible = true; - CloseErrorButton.Click += StartZitiService; - } - semaphoreSlim.Release(); - SetCantDisplay("Service Not Started", "Do you want to start the data service now?", Visibility.Visible); + this.Dispatcher.Invoke(() => { + semaphoreSlim.Wait(); //make sure the event is only added to the button once + CloseErrorButton.Click -= CloseError; + if (!startZitiButtonVisible) { + CloseErrorButton.Content = "Start Service"; + startZitiButtonVisible = true; + CloseErrorButton.Click += StartZitiService; + } + semaphoreSlim.Release(); + SetCantDisplay("Service Not Started", "Do you want to start the data service now?", Visibility.Visible); + }); }