private async void RefreshTimerCallBack(object state) { await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Temperature = TemperatureSensor.Measure(); State = string.Concat("Temperature: ", Temperature.ToString(), "℃"); } ); }
private async void OnSend() { IsBusy = true; try { var temperatureToSend = TemperatureSensor.Measure(); var result = await MainManager.Send(temperatureToSend, DateTime.Now, DefaultLocation); Log += result; } catch (Exception ex) { State = ex.Message; Debug.WriteLine("Error : " + TemperatureSensor.Name + " - " + ex.Message); } IsBusy = false; }
private void OnTest() { IsBusy = true; try { var temperature = TemperatureSensor.Measure(); Temperature = temperature; State = string.Concat("Temperature: ", temperature.ToString(), "℃"); } catch (Exception ex) { State = ex.Message; Debug.WriteLine("Error : " + TemperatureSensor.Name + " - " + ex.Message); } IsBusy = false; }