diff options
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT/WindowsTicker.cs')
-rw-r--r-- | Xamarin.Forms.Platform.WinRT/WindowsTicker.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/WindowsTicker.cs b/Xamarin.Forms.Platform.WinRT/WindowsTicker.cs new file mode 100644 index 00000000..2e8d941d --- /dev/null +++ b/Xamarin.Forms.Platform.WinRT/WindowsTicker.cs @@ -0,0 +1,32 @@ +using System; +using Windows.UI.Xaml; + +#if WINDOWS_UWP + +namespace Xamarin.Forms.Platform.UWP +#else + +namespace Xamarin.Forms.Platform.WinRT +#endif +{ + internal class WindowsTicker : Ticker + { + DispatcherTimer _timer; + + 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(); + } + } +}
\ No newline at end of file |