private void StartEngine()
 {
     Task.Run(() =>
     {
         try
         {
             this.starting = true;
             Application.Current.Dispatcher.Invoke(CommandManager.InvalidateRequerySuggested);
             ConfigClient c = App.GetDefaultConfigClient();
             c.GetEngineState();
             c.InvokeThenClose(x => x.StartAll());
         }
         catch (EndpointNotFoundException ex)
         {
             Trace.WriteLine(ex.ToString());
             MessageBox.Show($"Could not contact the AutoSync service", "AutoSync service unavailable", MessageBoxButton.OK, MessageBoxImage.Error);
         }
         catch (Exception ex)
         {
             Trace.WriteLine(ex);
             MessageBox.Show($"Error starting the management agents\n{ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         }
         finally
         {
             this.starting = false;
         }
     }).ContinueWith(x => Application.Current.Dispatcher.Invoke(CommandManager.InvalidateRequerySuggested));
 }