方法前加 asyc,同步方法掉异步方法
public void Init()
{
buildUI();
}
// await 只能用在异步方法上面
public async void buildUI()
{
// buildUIAsync();
AppService appserv = new AppService();
TileList.Items.Clear();
List<AppModel> applst = await appserv.getappList(Convert.ToInt32(mainwin.UserDic["uid"]));
if(applst != null)
{
foreach (AppModel appm in applst)
{
AddTile(appm);
}
// 复制到本地App列表
localApps = new List<AppModel>(applst.ToArray());
}
}