public SingleExplorerDeployViewModel(IDeployDestinationExplorerViewModel destination, IDeploySourceExplorerViewModel source, IEnumerable <IExplorerTreeItem> selectedItems, IDeployStatsViewerViewModel stats, IShellViewModel shell, IPopupController popupController)
        {
            VerifyArgument.AreNotNull(new Dictionary <string, object> {
                { "destination", destination }, { "source", source }, { "selectedItems", selectedItems }, { "stats", stats }, { "popupController", popupController }
            });
            _destination = destination;
            // ReSharper disable once VirtualMemberCallInContructor
            PopupController = popupController;

            _source             = source;
            _errorMessage       = "";
            _source.Preselected = selectedItems;
            _stats = stats;
            _shell = shell;
            _stats.CalculateAction = () =>
            {
                ServicesCount     = _stats.Services.ToString();
                SourcesCount      = _stats.Sources.ToString();
                NewResourcesCount = _stats.NewResources.ToString();
                OverridesCount    = _stats.Overrides.ToString();
                ConflictItems     = _stats.Conflicts;
                NewItems          = _stats.New;
                ShowConflicts     = false;
                if (!string.IsNullOrEmpty(_stats.RenameErrors))
                {
                    PopupController.ShowDeployNameConflict(_stats.RenameErrors);
                }
                ViewModelUtils.RaiseCanExecuteChanged(DeployCommand);
            };
            SourceConnectControlViewModel      = _source.ConnectControlViewModel;
            DestinationConnectControlViewModel = _destination.ConnectControlViewModel;

            SourceConnectControlViewModel.SelectedEnvironmentChanged      += UpdateServerCompareChanged;
            DestinationConnectControlViewModel.SelectedEnvironmentChanged += UpdateServerCompareChanged;
            DeployCommand                   = new DelegateCommand(Deploy, () => CanDeploy);
            SelectDependenciesCommand       = new DelegateCommand(SelectDependencies, () => CanSelectDependencies);
            NewResourcesViewCommand         = new DelegateCommand(ViewNewResources);
            OverridesViewCommand            = new DelegateCommand(ViewOverrides);
            Destination.ServerStateChanged += DestinationServerStateChanged;
            Destination.PropertyChanged    += DestinationOnPropertyChanged;
            ShowConflicts                   = false;
        }