private void BeginTrackingProgress(RequestProgressState state) { var existing = ProgressResults.FirstOrDefault(p => p.ManagedItem.Id == state.ManagedItem.Id); if (existing != null) { ProgressResults.Remove(existing); } ProgressResults.Add(state); RaisePropertyChanged(nameof(HasRequestsInProgress)); }
private void UpdateRequestTrackingProgress(RequestProgressState state) { App.Current.Dispatcher.Invoke((Action) delegate { var existing = ProgressResults.FirstOrDefault(p => p.ManagedCertificate.Id == state.ManagedCertificate.Id); if (existing != null) { //replace state of progress request var index = ProgressResults.IndexOf(existing); ProgressResults[index] = state; } else { ProgressResults.Add(state); } RaisePropertyChangedEvent(nameof(HasRequestsInProgress)); RaisePropertyChangedEvent(nameof(ProgressResults)); }); }