Forum Xamarin.Forms

Sleep app in the middle of a bucle.

GMLlaonaGMLlaona USMember
edited January 2017 in Xamarin.Forms

Hi guys, I've got a problem. I've got an app with a loop, that gets and process values and it represents this values on a circular gauge.

I invoke "Device.StartTimer (TimeSpan.FromMilliseconds (10), () =>" to create the animation and I do not want to get the next value until the gauge has the value that matches with the actual value.

My problem is that:
I tried to use Task.Delay to wait for the next value, but if the difference between the current value and the previous value is a few big,
The loop starts again, with no time for the gauge to complete the current round.
Can anyone help me? Thank you very much!

PD: I'm using Xamarin Forms portable!

Sign In or Register to comment.