我有这个计时器在我的代码:有没有办法在Xamarin中取消正在运行的计时器?
Device.StartTimer(TimeSpan.FromSeconds(100),() =>
{
Device.BeginInvokeOnMainThread(() =>
{
if (detailGrid.IsVisible == true)
{
getRandomPhase();
}
});
return false;
});
有没有办法,我可以(通过手势)取消计时器运行或中止以某种方式计时器的方法吗?
你想停止计时器? ,返回false仅用于停止定时器 –
改为使用AdvancedTimer - https://github.com/ufuf/AdvancedTimer – Jason