예제 #1
0
 protected virtual void OnCompassDataChanged(CompassDataChangedEventArgs e)//このメソッドでイベント発行。
 {
     if (CompassDataChanged != null)
     {
         CompassDataChanged(this, e);
     }
 }
예제 #2
0
 private void Sensor_CompassDataChanged(object sender, CompassDataChangedEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         refreshCompassData();
     });
 }
예제 #3
0
 void sensor_CompassDataChanged(object sender, CompassDataChangedEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         TextBlock_HeadingAccuracy.Text    = Sensor.HeadingAccuracy.ToString();
         TextBlock_MagneticHeading.Text    = Sensor.MagneticHeading.ToString();
         TextBlock_TrueHeading.Text        = Sensor.TrueHeading.ToString();
         TextBlock_IsCompassDataValid.Text = Sensor.IsCompassDataValid.ToString();
     });
 }
예제 #4
0
        void cmp_CurrentValueChanged(object sender, SensorReadingEventArgs <CompassReading> e)
        {
            IsCompassDataValid = cmp.IsDataValid;
            TrueHeading        = e.SensorReading.TrueHeading;
            MagneticHeading    = e.SensorReading.MagneticHeading;
            HeadingAccuracy    = e.SensorReading.HeadingAccuracy;
            //_rawMagnetometerReading = e.SensorReading.MagnetometerReading;

            CompassDataChangedEventArgs changedEvent = new CompassDataChangedEventArgs();

            OnCompassDataChanged(changedEvent);//イベントを発行する。
        }