private void DoRefresh() { Dispatcher.Invoke(() => { DebugLogging.Enable = Logging.IsChecked.Value; }); try { if (_currentDataGridDirty) { if (!CheckSaveChanges()) { return; } } var cursor = Cursors.Arrow; Dispatcher.Invoke(() => { cursor = Cursor; RefreshButton.IsEnabled = false; Projects.ItemsSource = null; Schemas.ItemsSource = null; Tables.ItemsSource = null; DataGrid.DataContext = null; Cursor = Cursors.Wait; }); _solution = new SolutionParser(new ProjectEnumerator(), new DacParserBuilder(), this); Dispatcher.Invoke(() => { Projects.ItemsSource = _solution.GetProjects(); Cursor = cursor; RefreshButton.IsEnabled = true; }); } catch (Exception e) { Dispatcher.Invoke(() => { LastStatusMessage.Text = "Error see output window"; }); OutputWindowMessage.WriteMessage("Error Enumerating projects:"); OutputWindowMessage.WriteMessage(e.Message); } }