Exemple #1
0
 internal static void OnChanged(MagnetometerChangedEventArgs e)
 {
     if (useSyncContext)
     {
         MainThread.BeginInvokeOnMainThread(() => ReadingChanged?.Invoke(null, e));
     }
     else
     {
         ReadingChanged?.Invoke(null, e);
     }
 }
        internal static void OnChanged(MagnetometerChangedEventArgs e)
        {
            if (ReadingChanged == null)
            {
                return;
            }

            if (UseSyncContext)
            {
                Platform.BeginInvokeOnMainThread(() => ReadingChanged?.Invoke(e));
            }
            else
            {
                ReadingChanged?.Invoke(e);
            }
        }
Exemple #3
0
        internal static void OnChanged(MagnetometerChangedEventArgs e)
        {
            var handler = ReadingChanged;

            if (handler == null)
            {
                return;
            }

            if (useSyncContext)
            {
                MainThread.BeginInvokeOnMainThread(() => handler?.Invoke(null, e));
            }
            else
            {
                handler?.Invoke(null, e);
            }
        }