void ProgressGroupFinished(object sender, EventArgs e) { var group = (ProgressGroup)sender; lock (_SyncLock) ProgressGroups.Remove(group); OnPropertyChanged("HasRunning"); }
public void Add(ProgressGroup group) { group.IsRegistered = true; group.Completed += ProgressGroupFinished; lock (_SyncLock) ProgressGroups.Add(group); OnPropertyChanged("HasRunning"); }
public void Register(ProgressGroup group) { bool contains; lock (_SyncLock) contains = ProgressGroups.Contains(group); if (!contains) { group.IsRegistered = true; group.Completed += ProgressGroupFinished; lock (_SyncLock) ProgressGroups.Add(group); OnPropertyChanged("HasRunning"); } }