public async void CancelDownloads(CancelDownloads cancel) { Console.WriteLine("[Downloadanager] CancelDownloads"); var queued = _repo.ByState(new [] { State.Downloading, State.Waiting, State.Error }); foreach (var queue in queued) { queue.Cancel(); } _repo.UpdateAll(queued); foreach (var queue in queued) { await _bus.SendAsync <NotifyProgress> (new NotifyProgress { Url = queue.Url, Download = queue }); } }