Partager via


UIBarItem.Notifications.ObserveDarkerSystemColorsStatusDidChange Méthode

Définition

Surcharges

ObserveDarkerSystemColorsStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DarkerSystemColorsStatusDidChangeNotification constante.

ObserveDarkerSystemColorsStatusDidChange(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DarkerSystemColorsStatusDidChangeNotification constante.

ObserveDarkerSystemColorsStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DarkerSystemColorsStatusDidChangeNotification constante.

public static Foundation.NSObject ObserveDarkerSystemColorsStatusDidChange (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveDarkerSystemColorsStatusDidChange : Foundation.NSObject * EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject

Paramètres

objectToObserve
NSObject

Objet à observer.

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lorsque la notification est publiée.

Retours

Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)

Remarques

Cette méthode peut être utilisée pour DarkerSystemColorsStatusDidChangeNotification s’abonner aux notifications.

// Listen to all notifications posted for any object
var token = UIBarItem.Notifications.ObserveDarkerSystemColorsStatusDidChange ((notification) => {
	Console.WriteLine ("Observed DarkerSystemColorsStatusDidChangeNotification!");
};

// Listen to all notifications posted for a single object
var token = UIBarItem.Notifications.ObserveDarkerSystemColorsStatusDidChange (objectToObserve, (notification) => {
	Console.WriteLine ($"Observed DarkerSystemColorsStatusDidChangeNotification for {nameof (objectToObserve)}!");
};

// Stop listening for notifications
token.Dispose ();

S’applique à

ObserveDarkerSystemColorsStatusDidChange(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DarkerSystemColorsStatusDidChangeNotification constante.

public static Foundation.NSObject ObserveDarkerSystemColorsStatusDidChange (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveDarkerSystemColorsStatusDidChange : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject

Paramètres

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lorsque la notification est publiée.

Retours

Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)

Remarques

Cette méthode peut être utilisée pour DarkerSystemColorsStatusDidChangeNotification s’abonner aux notifications.

// Listen to all notifications posted for any object
var token = UIBarItem.Notifications.ObserveDarkerSystemColorsStatusDidChange ((notification) => {
	Console.WriteLine ("Observed DarkerSystemColorsStatusDidChangeNotification!");
};

// Listen to all notifications posted for a single object
var token = UIBarItem.Notifications.ObserveDarkerSystemColorsStatusDidChange (objectToObserve, (notification) => {
	Console.WriteLine ($"Observed DarkerSystemColorsStatusDidChangeNotification for {nameof (objectToObserve)}!");
};

// Stop listening for notifications
token.Dispose ();

S’applique à