Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Device.StartTimer - How to cancel it??

$
0
0

I have a timer set on my authenticated pages so that after N minutes, it'll log them out. Works.

How do I disable a timer once I have created it though? I don't want it to fire if they do XYZ, or I want to reset it. There is no reference to the timer given so I can interact with it once it has been set.

    private void StartLogoutTimer()
    {
        Device.StartTimer(new TimeSpan(0, 0, 25, 0), () =>
        {
            Device.BeginInvokeOnMainThread(Logout);
            return false;
        }); 
    }

Viewing all articles
Browse latest Browse all 58056

Trending Articles