Ejemplo n.º 1
0
 public void Run(WorkItem item)
 {
     items.Add(item);
     item.RunWorkerCompleted += (x, y) => { items.Remove(item); };
     Progresser.Default.AddItem(new ProgressItem(item));
     RuntimeContainers.Current.OpenContent<Progresser>();
     if (!item.IsBusy)
         item.RunWorkerAsync();
 }
Ejemplo n.º 2
0
 public ProgressItem(WorkItem item)
 {
     Worker = item;
     Name = item.Name;
     IsIndeterminate = !Worker.WorkerReportsProgress;
     CanCancel = Worker.WorkerSupportsCancellation;
     Worker.ProgressChanged += (s, e) =>
     {
         Progress = e.ProgressPercentage;
         Message = e.UserState.ToSafeString();
     };
     Worker.RunWorkerCompleted += (s, e) => { CanCancel = true; };
 }