Freigeben über


UIBarItem.Notifications.ObserveDarkerSystemColorsStatusDidChange Methode

Definition

Überlädt

ObserveDarkerSystemColorsStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Stark typisierte Benachrichtigung für die DarkerSystemColorsStatusDidChangeNotification Konstante.

ObserveDarkerSystemColorsStatusDidChange(EventHandler<NSNotificationEventArgs>)

Stark typisierte Benachrichtigung für die DarkerSystemColorsStatusDidChangeNotification Konstante.

ObserveDarkerSystemColorsStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Stark typisierte Benachrichtigung für die DarkerSystemColorsStatusDidChangeNotification Konstante.

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

Parameter

objectToObserve
NSObject

Das zu beobachtende Objekt.

handler
EventHandler<NSNotificationEventArgs>

Methode zum Aufrufen, wenn die Benachrichtigung veröffentlicht wird.

Gibt zurück

Tokenobjekt, das verwendet werden kann, um den Empfang von Benachrichtigungen zu beenden, indem es entweder veräußert oder an übergeben wird RemoveObservers(IEnumerable<NSObject>)

Hinweise

Diese Methode kann verwendet werden, um Benachrichtigungen zu abonnieren DarkerSystemColorsStatusDidChangeNotification .

// 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 ();

Gilt für:

ObserveDarkerSystemColorsStatusDidChange(EventHandler<NSNotificationEventArgs>)

Stark typisierte Benachrichtigung für die DarkerSystemColorsStatusDidChangeNotification Konstante.

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

Parameter

handler
EventHandler<NSNotificationEventArgs>

Methode zum Aufrufen, wenn die Benachrichtigung veröffentlicht wird.

Gibt zurück

Tokenobjekt, das verwendet werden kann, um den Empfang von Benachrichtigungen zu beenden, indem es entweder veräußert oder an übergeben wird RemoveObservers(IEnumerable<NSObject>)

Hinweise

Diese Methode kann verwendet werden, um Benachrichtigungen zu abonnieren DarkerSystemColorsStatusDidChangeNotification .

// 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 ();

Gilt für: