public MutationExplorerWindowViewModel( EnvironmentService environmentService, ConfigService configService, RunningDocTableEvents runningDocTableEvents, IMediator mediator) { Mutations = new ObservableCollection <MutationRunItem>(); _mutationRunDocumentService = new MutationRunDocumentService(environmentService, Mutations); _environmentService = environmentService; _configService = configService; _mediator = mediator; _filterItems = new List <MutationDocumentFilterItem>(); _selectedMutations = new List <MutationRunItem>(); RunMutationsCommand = new DelegateCommand(() => RunMutations(Mutations)); MutationSelectedCommand = new DelegateCommand <MutationRunItem>(UpdateSelectedMutation); MutationsSelectedCommand = new DelegateCommand <System.Collections.IList>((mutations) => _selectedMutations = mutations.Cast <MutationRunItem>()); GoToMutationCommand = new DelegateCommand <MutationRunItem>( mutation => _environmentService.GoToLine(mutation.Document.FilePath, mutation.Document.MutationDetails.Location.GetLineNumber())); HighlightChangedCommand = new DelegateCommand <bool>(HightlightChanged); ToggleMutation = new DelegateCommand(() => IsMutationVisible = !IsMutationVisible); ShowMutationDetailsCommand = new DelegateCommand(ShowMutationDetails); RemoveKilledMutationsCommand = new DelegateCommand(RemovedKilledMutations); RunOnlySurvivingMutationsCommand = new DelegateCommand(RunOnlySurvivingMutations); RefreshMutationsCommand = new DelegateCommand(() => Initialize(_originalFilterItems)); RunSelectedMutationsCommand = new DelegateCommand(RunSelectedMutations); SaveReportCommand = new DelegateCommand(SaveReport); StopCommand = new DelegateCommand(() => { IsStopButtonEnabled = false; _tokenSource.Cancel(); }); runningDocTableEvents.BeforeSave += RunningDocTableEventsOnBeforeSave; environmentService.JoinableTaskFactory.Run(async() => { await environmentService.JoinableTaskFactory.SwitchToMainThreadAsync(); environmentService.Dte.Events.SolutionEvents.BeforeClosing += ResetWindow; }); _showhighlight = true; }