I'm new to xamarin forms. So therefore I have a trouble with UI updating. I'm using Device.BeginInvokeOnMainThread to update value on Dashboard. But it doesnt work. It updates value only with reload of the page:
public Dashboard ()
{
InitializeComponent ();
Init();
}
public void Init()
{
Task.Run(async () =>
{
float speed = MainPage.acceleration;
if (speed < 0)
{
speed = speed * (-1);
}
Device.BeginInvokeOnMainThread(() =>
{
Value.Text = speed.ToString();
});
});
}