代码:
//randDoc已经在其他地方定义
public async void GetDoc()
{
for (int i = 0; i < randDoc.GetArrayLength(); i++)
{
Button button = new Button { Text = randDoc[i].GetProperty("id").GetInt32().ToString()};
button.Clicked += GoToDoc(randDoc[i].GetProperty("id").GetInt32()); //这行报错
stack.Children.Add(button);
}
}
public void GoToDoc(int id)
{}