Skip to content

Commit

Permalink
Improve sample
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis committed Aug 17, 2023
1 parent 541e727 commit 9f2d222
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion samples/Plugin.Maui.Pedometer.Sample/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ public MainPage(IPedometer pedometer)

void Pedometer_PedometerReadingChanged(object sender, PedometerData e)
{
StepCount.Text = e.NumberOfSteps.ToString();
MainThread.InvokeOnMainThreadAsync(() =>
{
StepCount.Text = e.NumberOfSteps.ToString();
});
}

void Button_Clicked(object sender, EventArgs e)
Expand Down

0 comments on commit 9f2d222

Please sign in to comment.