【发布时间】:2017-12-25 16:31:21
【问题描述】:
我的代码如下所示:
public void Init() {
if (AS.pti == PTI.UserInput)
{
AS.runCardTimer = false;
}
else
{
AS.runCardTimer = true;
Device.BeginInvokeOnMainThread(() => showCards().ContinueWith((arg) => { }));
}
}
Init 方法是从构造函数中调用的。有人可以向我解释一下为什么开发人员可能添加了 Device.BeginInvokeOnMainThread() 而不仅仅是调用方法 showCards?
ContinueWith((arg)) 还有什么作用以及为什么要包含它?
【问题讨论】:
-
请显示 showCards() 方法的代码或至少告诉我们它的作用
标签: xamarin xamarin.forms