Freigeben über


UIView.Notifications.ObserveInvertColorsStatusDidChange Methode

Definition

Überlädt

ObserveInvertColorsStatusDidChange(EventHandler<NSNotificationEventArgs>)

Stark typisierte Benachrichtigung für die InvertColorsStatusDidChangeNotification Konstante.

ObserveInvertColorsStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Stark typisierte Benachrichtigung für die InvertColorsStatusDidChangeNotification Konstante.

ObserveInvertColorsStatusDidChange(EventHandler<NSNotificationEventArgs>)

Stark typisierte Benachrichtigung für die InvertColorsStatusDidChangeNotification Konstante.

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

Parameter

handler
EventHandler<NSNotificationEventArgs>

Methode, die aufgerufen wird, wenn die Benachrichtigung bereitgestellt wird.

Gibt zurück

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

Hinweise

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

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

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

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

Gilt für:

ObserveInvertColorsStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Stark typisierte Benachrichtigung für die InvertColorsStatusDidChangeNotification Konstante.

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

Parameter

objectToObserve
NSObject

Das zu beobachtende Objekt.

handler
EventHandler<NSNotificationEventArgs>

Methode, die aufgerufen wird, wenn die Benachrichtigung bereitgestellt wird.

Gibt zurück

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

Hinweise

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

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

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

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

Gilt für: