void UploadStatusChanged(object sender, UploadStatusEventArgs e) { if (e.Status < UploadStatus.Success && !_active) { _active = true; _main.Dispatcher.Invoke(new Func<UploadViewModel, bool>(_main.Complete.Remove), this); _main.Dispatcher.Invoke(new Action<UploadViewModel>(_main.Active.Add), this); } else if (e.Status >= UploadStatus.Success && _active) { _active = false; _main.Dispatcher.Invoke(new Func<UploadViewModel, bool>(_main.Active.Remove), this); _main.Dispatcher.Invoke(new Action<UploadViewModel>(_main.Complete.Add), this); } SetStatusMessage(); OnPropertyChanged(new PropertyChangedEventArgs("StatusMessage")); OnPropertyChanged(new PropertyChangedEventArgs("Status")); LogStatusChange(); }
internal void OnUploadStatusChanged(UploadStatusEventArgs e) { var evt = StatusChanged; if (evt != null) evt(this, e); }