maui-linux/Xamarin.Forms.Platform.WinRT/WindowsTicker.cs

32 строки
560 B
C#
Исходник Обычный вид История

2016-03-22 23:02:25 +03:00
using System;
using Windows.UI.Xaml;
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
{
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();
}
}
}