private async void setCurrentSteps(string CurrentStepsS) { if (MiBand.Ready) { var loader = new Windows.ApplicationModel.Resources.ResourceLoader(); Int32 CurrentSteps = 0; if (Int32.TryParse(CurrentStepsS, out CurrentSteps)) { bool ret = await band.SetCurrentSteps(CurrentSteps); if (ret) { properties.CurrentSteps = CurrentSteps; } else { MessageDialog dialog = new MessageDialog(loader.GetString("SetStepsError"), loader.GetString("ErrorTitle")); await dialog.ShowAsync(); } } else { MessageDialog dialog = new MessageDialog(loader.GetString("SetStepsInvalid"), loader.GetString("ErrorTitle")); await dialog.ShowAsync(); } } }