我想在我的基於Xamarin Forms的項目中使用System.Timer。我實際上將我的Xamarin iOS項目轉換爲Xamarin Formbased項目。我Xamarin的iOS項目有使用System.TimerXamarin使用System.Timers和Sysem.Json形式錯誤
aTimer = new Timer (tm);
// Hook up the Elapsed event for the timer.
aTimer.Elapsed += new ElapsedEventHandler (OnTimedEvent);
aTimer.Enabled = true;
aTimer.Start();
當我嘗試使用Xamarin形式相同的代碼工程中,給錯誤定時器所有代碼。首先
using System.Timers;
它說:類型或命名空間名稱定時器不存在於命名空間系統中。您是否缺少裝配參考?
Xamarin iOS系統與Xamarin Forms系統參考不同嗎?
我有兩個按鈕1 - 開始計時器和2 - 停止計時器。考慮到上面的代碼,我如何啓動和停止按鈕單擊計時器。在上面的代碼中,它具有分配新實例的新TimeSpan(0,0,60)。如何在STOP按鈕單擊時返回FALSE。 – User382
看到我上面的編輯 – Jason