summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8/WinPhoneTicker.cs
blob: 706149c635821e7030c11a241339b4f64f38ed83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Windows.Threading;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms
{
	internal class WinPhoneTicker : Ticker
	{
		readonly DispatcherTimer _timer;

		public WinPhoneTicker()
		{
			_timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(15) };
			_timer.Tick += (sender, args) => SendSignals();
		}

		protected override void DisableTimer()
		{
			_timer.Stop();
		}

		protected override void EnableTimer()
		{
			_timer.Start();
		}
	}
}