wrap ShowServiceNotStarted in the dispatcher

This commit is contained in:
ziti-ci
2020-12-18 13:43:47 -05:00
parent 0c88c3bd5a
commit 4ef804e4e6
+11 -9
View File
@@ -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);
});
}