public async void LibPageChange()
{
Task<string> trt = FileSystem.Read("LibList");
string rs = await trt;//re=read result;
string res;
int flag = 1;//1表示弹窗报错
Task<string> result;
if ((!string.IsNullOrEmpty(rs)) && (rs != "error"))
{
res = rs;
flag = 0;
result = app.User.Library(flag);
}
else
{
result = app.User.Library(flag);
res = await result;
}
if (res != "error")
{
MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(res));
try
{
Library myLibrary = JsonParse.Parse<Library>(ms);
LibSummary.Text = "";
for (int i = 0; i < myLibrary.content.GetLength(0); i++)
{
LibItems.Items.Add(TextBlockCreate(myLibrary.content[i]));
}
if (myLibrary.content.GetLength(0)==0)
LibSummary.Text = "你没有借阅图书哦~";
}
catch (Exception e)
{
}
}
else
{
LibSummary.Text = "不好意思,出了一点问题。。。";
}
res = await result;
if (res != "error")
{
FileSystem.Write("LibList", res);
}
}
public LibPage()