コード例 #1
0
        public BackupPlanModel(ExecutableBackupPlan executableBackupPlan)
        {
            this.executableBackupPlan = executableBackupPlan;

            executableBackupPlan.Events.IsRunning  += (o, e) => IsRunning = e.IsRunning;
            executableBackupPlan.Events.Progress   += (o, e) => Progress = e.Progress;
            executableBackupPlan.Events.StatusText += (o, e) => StatusText = e.StatusText;
            executableBackupPlan.Events.HasErrors  += (o, e) => HasErrors = e.HasErrors;
            executableBackupPlan.Events.CanExecute += (o, e) => CanExecute = e.CanExecute;

            ExecutePlanCommand = ReactiveCommand.CreateFromTask(executableBackupPlan.Execution.ExecuteAsync);
        }
コード例 #2
0
        public BackupPlanViewModel(ExecutableBackupPlan executableBackupPlan)
        {
            this.executableBackupPlan = executableBackupPlan;

            executableBackupPlan.Events.IsRunning  += (o, e) => IsRunning = e.IsRunning;
            executableBackupPlan.Events.Progress   += (o, e) => Progress = e.Progress;
            executableBackupPlan.Events.StatusText += (o, e) => StatusText = e.StatusText;
            executableBackupPlan.Events.HasErrors  += (o, e) => HasErrors = e.HasErrors;
            executableBackupPlan.Events.CanExecute += (o, e) => CanExecute = e.CanExecute;

            ExecutePlanCommand = new RelayCommand(() => executableBackupPlan.Execution.ExecuteAsync(), () => true);
        }