Esempio n. 1
0
        public DeploymentViewModel(
            IWindowsOptionsProvider optionsProvider,
            IWoaDeployer deployer, UIServices uiServices, AdvancedViewModel advancedViewModel,
            WimPickViewModel wimPickViewModel)
        {
            this.optionsProvider   = optionsProvider;
            this.deployer          = deployer;
            this.uiServices        = uiServices;
            this.advancedViewModel = advancedViewModel;
            this.wimPickViewModel  = wimPickViewModel;

            var isSelectedWim = wimPickViewModel.WhenAnyObservable(x => x.WimMetadata.SelectedImageObs)
                                .Select(metadata => metadata != null);

            FullInstallWrapper = new CommandWrapper <Unit, Unit>(this,
                                                                 ReactiveCommand.CreateFromTask(Deploy, isSelectedWim), uiServices.Dialog);
            IsBusyObservable = FullInstallWrapper.Command.IsExecuting;
            isBusyHelper     = IsBusyObservable.ToProperty(this, model => model.IsBusy);
        }
Esempio n. 2
0
        public DeploymentViewModel(
            IDeploymentContext context,
            IWoaDeployer woaDeployer,
            IOperationContext operationContext, UIServices uiServices, AdvancedViewModel advancedViewModel, IOperationProgress progress,
            WimPickViewModel wimPickViewModel, IFileSystemOperations fileSystemOperations, ILumiaSettingsService lumiaSettingsService)
        {
            this.context              = context;
            this.woaDeployer          = woaDeployer;
            this.uiServices           = uiServices;
            this.advancedViewModel    = advancedViewModel;
            this.wimPickViewModel     = wimPickViewModel;
            this.fileSystemOperations = fileSystemOperations;
            this.lumiaSettingsService = lumiaSettingsService;

            var isSelectedWim = wimPickViewModel.WhenAnyObservable(x => x.WimMetadata.SelectedImageObs)
                                .Select(metadata => metadata != null);

            FullInstallWrapper = new ProgressViewModel(ReactiveCommand.CreateFromTask(Deploy, isSelectedWim), progress, this, uiServices.ContextDialog, operationContext);
            IsBusyObservable   = FullInstallWrapper.Command.IsExecuting;
            isBusyHelper       = IsBusyObservable.ToProperty(this, model => model.IsBusy);
        }