Example #1
0
        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);
        }
Example #2
0
        public void ProgressWorkerViewModelTest()
        {
            ProgressViewModel target = new ProgressWorkerViewModel("Some task...");

            ProgressViewModelTestRun(target);
        }