async void CreatorList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (creatorQueue.Count > 0) { await Task.Delay(300); await DispatcherHelper.RunAsync(() => { if (creatorQueue.Count > 0) { var gc = creatorQueue.Dequeue(); CreatorList.Add(gc); } }); } }
async void AddCreators(ResourceLoader loader) { creatorQueue.Clear(); CreatorList.Clear(); var developGroup = new GroupCollection <Account>(loader.GetString("AboutDevelopment")); developGroup.Add(new Account() { Contact = string.Format(FACEBOOK_SUPPORT, "yookjy"), ContactName = "@facebook", ContactType = ContactType.Web, Contact2 = "http://yookjy.wordpress.com", ContactName2 = "@blog", ContactType2 = ContactType.Web, Name = loader.GetString("AboutDeveloper") }); var designGroup = new GroupCollection <Account>(loader.GetString("AboutDesign")); designGroup.Add(new Account() { Contact = string.Format(FACEBOOK_SUPPORT, "yookjy"), ContactName = "@facebook", ContactType = ContactType.Web, Contact2 = "http://yookjy.wordpress.com", ContactName2 = "@blog", ContactType2 = ContactType.Web, Name = loader.GetString("AboutDesigner") }); creatorQueue.Enqueue(developGroup); creatorQueue.Enqueue(designGroup); await DispatcherHelper.RunAsync(() => { CreatorList.Add(creatorQueue.Dequeue()); }); }