public virtual void RunTask(string taskText, bool reportsProgress, Action <ProgressViewModel> task, Action taskComplete) { ProgressViewModel pvm = new ProgressWorkerViewModel(taskText); pvm.ReportsProgress = reportsProgress; this.ProgressViewModels.Add(pvm); pvm.ActionComplete = () => { if (taskComplete != null) { taskComplete.Invoke(); } this.ProgressViewModels.Remove(pvm); }; pvm.ActionWork = task; pvm.ExecuteCommand.Execute(null); }
public void ProgressWorkerViewModelTest() { ProgressViewModel target = new ProgressWorkerViewModel("Some task..."); ProgressViewModelTestRun(target); }