方法前加 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());
}
}

相关文章:

  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-06-19
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-10
  • 2021-06-21
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案