Skip to content

Instantly share code, notes, and snippets.

@saggy
Forked from arlm/CountDown.cs
Created December 9, 2015 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saggy/70f9e5a483a74495dfff to your computer and use it in GitHub Desktop.
Save saggy/70f9e5a483a74495dfff to your computer and use it in GitHub Desktop.
How to use CountDownTimer on Xamarin.Android
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