Created
January 4, 2014 20:09
-
-
Save arlm/8260067 to your computer and use it in GitHub Desktop.
How to use CountDownTimer on Xamarin.Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Android.App; | |
using Android.Content; | |
using Android.OS; | |
using Android.Runtime; | |
using Android.Views; | |
using Android.Widget; | |
namespace MyTimer | |
{ | |
public delegate void TickEvent (long millisUntilFinished); | |
public delegate void FinishEvent (); | |
public class CountDown : CountDownTimer | |
{ | |
public event TickEvent Tick; | |
public event FinishEvent Finish; | |
public CountDown(long totaltime, long interval) | |
: base(totaltime,interval) | |
{ | |
} | |
public override void OnTick (long millisUntilFinished) | |
{ | |
if (Tick != null) | |
Tick (millisUntilFinished); | |
} | |
public override void OnFinish () | |
{ | |
if (Finish != null) | |
Finish (); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment