HKHealthStore.UserPreferencesDidChangeNotification Proprietà

Definizione

Costante di notifica per UserPreferencesDidChange

[Foundation.Advice("Use HKHealthStore.Notifications.ObserveUserPreferencesDidChange helper method instead.")]
[Foundation.Field("HKUserPreferencesDidChangeNotification", "HealthKit")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 8, 2, ObjCRuntime.PlatformArchitecture.All, null)]
public static Foundation.NSString UserPreferencesDidChangeNotification { [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 8, 2, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.UserPreferencesDidChangeNotification : Foundation.NSString

Valore della proprietà

La costante NSString deve essere usata come token per NSNotificationCenter.

Attributi

Commenti

Questa costante può essere usata con per NSNotificationCenter registrare un listener per questa notifica. Si tratta di una stringa NSString anziché di una stringa, perché questi valori possono essere usati come token in alcune librerie native anziché essere usati esclusivamente per il relativo contenuto stringa effettivo. Il parametro 'notification' per il callback contiene informazioni aggiuntive specifiche del tipo di notifica.

// Lambda style
NSNotificationCenter.DefaultCenter.AddObserver (
        HKHealthStore.UserPreferencesDidChangeNotification, (notification) => {Console.WriteLine ("Received the notification HKHealthStore", notification); }


// Method style
void Callback (NSNotification notification)
{
    Console.WriteLine ("Received a notification HKHealthStore", notification);
}

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (HKHealthStore.UserPreferencesDidChangeNotification, Callback);
}

Si applica a