public async Task <ImageCollection> GetOrCreateCollectionAsync(StorageFolder folder) { var res = GetCollection(folder); if (res == null) { res = await ImageCollectionFactory.MakeCollectionAsync(folder).ConfigureAwait(false); Add(res); } return(res); }
private async void ServiceQueue(Object stateInfo) { WorkItem next = _work.Pull(); while (next != null) { next.clock.Report(200, "Serviced queue for " + next.folder.Path); var collection = await ImageCollectionFactory.MakeCollectionAsync(next.folder).ConfigureAwait(false); next.clock.Report(1000, "Background creation for " + next.folder.Path); _cache.Add(collection); next = _work.Pull(); } }