/// <summary> /// This is the event handler for ReadingChanged events. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> async private void ReadingChanged(object sender, AltimeterReadingChangedEventArgs e) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { AltimeterReading reading = e.Reading; ScenarioOutput_M.Text = String.Format("{0,5:0.00}", reading.AltitudeChangeInMeters); }); }
private void Altimeter_ReadingChanged(Altimeter sender, AltimeterReadingChangedEventArgs args) { if (SensorValueChanged == null) { return; } var reading = args.Reading; #if DEBUG Debug.WriteLine($"Altimeter Raised Event Altitude = {reading.AltitudeChangeInMeters}"); #endif SensorValueChanged((object)this, new SensorReadingValueChangedEventArgs() { SensorType = SensorType.Altimeter, ValueType = ValueType.SingleValue, Value = new SingleSensorValue() { Value = reading.AltitudeChangeInMeters, }, }); }
/// <summary> /// This is the event handler for ReadingChanged events. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> async private void ReadingChanged(object sender, AltimeterReadingChangedEventArgs e) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { AltimeterReading reading = e.Reading; ScenarioOutput_M.Text = String.Format("{0,5:0.00}", reading.AltitudeChangeInMeters); }); }
/// <summary> /// 高度变化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ReadingChanged(object sender, AltimeterReadingChangedEventArgs e) { nowH = e.Reading.AltitudeChangeInMeters; ApplicationData.Current.LocalSettings.Values["nowH"] = nowH; }