在我在 WallModel 方法中等待的代码中,但我不能使用异步。如何在此代码中使用 async 和 await ?
class WallModel
{
public WallModel()
{
WallItems = new ObservableCollection<Wall>();
HttpClient client = new HttpClient();
HttpResponseMessage response = await client.GetAsync("XXXXX");
string Parse_Text = await response.Content.ReadAsStringAsync();
}
public ObservableCollection<Wall> WallItems { get; set; }
}