/// <summary> /// 初始化 /// </summary> private async void InitCategories() { var tasks = new[] { this._netWorkServices.GetAsync <PlayListCategory[]>("FindMusic", "GetPlayListCategories"), this._netWorkServices.GetAsync <PlayListCategory[]>("FindMusic", "GetHotPlayListCategories") }; await Task.WhenAll(tasks); if (tasks.All(x => x.Result.Successed)) { await Task.WhenAll(AllCategories.AddRangeAsync(tasks[0].Result.Data), HotCategories.AddRangeAsync(tasks[1].Result.Data)); } else { //todo 网络提示信息 } }