public void Reflesh() { Status = "ニコレポ取得中"; IsActive = true; DispatcherHelper.UIDispatcher.BeginInvoke(new Action(() => NicoRepoListCollection.Clear())); Task.Run(() => { IList <NicoNicoNicoRepoListEntry> result = NicoRepoList.GetNicoRepoList(); foreach (NicoNicoNicoRepoListEntry entry in result) { NicoRepoListViewModel vm = new NicoRepoListViewModel(this, entry.Title, entry.Id); Status = "ニコレポ取得中(" + vm.Name + ")"; vm.OpenNicoRepoList(); DispatcherHelper.UIDispatcher.BeginInvoke(new Action(() => NicoRepoListCollection.Add(vm))); } IsActive = false; Status = ""; }); }
public void Reflesh() { Status = "ニコレポ取得中"; IsActive = true; DispatcherHelper.UIDispatcher.BeginInvoke(new Action(() => NicoRepoListCollection.Clear())); Task.Run(() => { IList<NicoNicoNicoRepoListEntry> result = NicoRepoList.GetNicoRepoList(); foreach(NicoNicoNicoRepoListEntry entry in result) { NicoRepoListViewModel vm = new NicoRepoListViewModel(this, entry.Title, entry.Id); Status = "ニコレポ取得中(" + vm.Name + ")"; vm.OpenNicoRepoList(); DispatcherHelper.UIDispatcher.BeginInvoke(new Action(() => NicoRepoListCollection.Add(vm))); } IsActive = false; Status = "ニコレポ取得完了"; }); }