No System.Timers? What's best way to update UI (like chronograph)?

threadythready CAMember ✭✭✭

Hi Xamarin Experts,
I tried to use a System.Timers.Timer - but saw that you need to downgrade to 4.0 or go to 4.5.1 to get these? I'm not even able to change to 4.5.1 for some reason.

What's my best option to do this without having to change default project settings?

Thanks!
Mike

Posts

  • threadythready CAMember ✭✭✭

    Answer: async / await. Wonderful stuff.

  • ChaseFlorellChaseFlorell CAInsider, University mod
    await Task.Delay(duration);
    
  • rogiheerogihee NLMember ✭✭✭

    Or use

    public static void StartTimer (TimeSpan interval, Func<bool> callback)

    in Xamarin.Forms.Device class

  • threadythready CAMember ✭✭✭

    Thanks Chase, that's what I used indeed. Thanks Rogier, I'm debating on changing to that! They're both equally nice. I think I particularly like the ease of async and await though- and mostly just excited to finally get it! :-)

Sign In or Register to comment.