private async Task GetData(EmptyClass ec) { IsBusy = true; Func <ObservableCollection <ClassListLight> > calcw = () => { ObservableCollection <ClassListLight> w = new ObservableCollection <ClassListLight>(); w = ec.getweekresult(); return(w); }; Func <ObservableCollection <EmptyTable> > calct = () => { ObservableCollection <EmptyTable> t = new ObservableCollection <EmptyTable>(); t = ec.gettermresult(); return(t); }; if (ec.Weeknum != -100) { Debug.WriteLine(DateTime.Now.Second + "开始0异步" + DateTime.Now.Millisecond); this.result = await Task.Run(calcw); Debug.WriteLine(DateTime.Now.Second + "结束0异步" + DateTime.Now.Millisecond); } else { Debug.WriteLine(DateTime.Now.Second + "开始1异步" + DateTime.Now.Millisecond); this.termresult = await Task.Run(calct); Debug.WriteLine(DateTime.Now.Second + "结束1异步" + DateTime.Now.Millisecond); } IsBusy = false; }