2016-03-22 23:02:25 +03:00
|
|
|
|
using System;
|
|
|
|
|
using Windows.UI.Xaml;
|
2016-04-25 22:57:44 +03:00
|
|
|
|
using Xamarin.Forms.Internals;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
|
|
|
|
#if WINDOWS_UWP
|
|
|
|
|
namespace Xamarin.Forms.Platform.UWP
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
namespace Xamarin.Forms.Platform.WinRT
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
internal class WindowsTicker : Ticker
|
|
|
|
|
{
|
2016-04-25 22:57:44 +03:00
|
|
|
|
readonly DispatcherTimer _timer;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
|
|
|
|
public WindowsTicker()
|
|
|
|
|
{
|
|
|
|
|
_timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(15) };
|
|
|
|
|
_timer.Tick += (sender, args) => SendSignals();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void DisableTimer()
|
|
|
|
|
{
|
|
|
|
|
_timer.Stop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void EnableTimer()
|
|
|
|
|
{
|
|
|
|
|
_timer.Start();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|