我在Xamarin.Android
中使用了System.Threading.Timer
。
我如何在Xamarin.Forms
中使用相同的类?
(我想将我的项目从Xamarin.Android转移到Xamarin.Forms)
public static System.Threading.Timer timer;
if (timer == null)
{
System.Threading.TimerCallback tcb = MyMethod;
timer = new System.Threading.Timer(tcb, null, 700, System.Threading.Timeout.Infinite);
}
else
{
timer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
timer.Change(700, System.Threading.Timeout.Infinite);
}
System.Timers
吗? - Sinatr