Bagikan melalui


UIView.Notifications.ObserveDarkerSystemColorsStatusDidChange Metode

Definisi

Overload

ObserveDarkerSystemColorsStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Pemberitahuan yang sangat ditik untuk DarkerSystemColorsStatusDidChangeNotification konstanta.

ObserveDarkerSystemColorsStatusDidChange(EventHandler<NSNotificationEventArgs>)

Pemberitahuan yang sangat ditik untuk DarkerSystemColorsStatusDidChangeNotification konstanta.

ObserveDarkerSystemColorsStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Pemberitahuan yang sangat ditik untuk DarkerSystemColorsStatusDidChangeNotification konstanta.

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

Objek yang akan diamati.

handler
EventHandler<NSNotificationEventArgs>

Metode untuk memanggil saat pemberitahuan diposting.

Mengembalikan

Objek token yang dapat digunakan untuk berhenti menerima pemberitahuan dengan membuangnya atau meneruskannya ke RemoveObservers(IEnumerable<NSObject>)

Keterangan

Metode ini dapat digunakan untuk berlangganan DarkerSystemColorsStatusDidChangeNotification pemberitahuan.

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

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

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

Berlaku untuk

ObserveDarkerSystemColorsStatusDidChange(EventHandler<NSNotificationEventArgs>)

Pemberitahuan yang sangat ditik untuk DarkerSystemColorsStatusDidChangeNotification konstanta.

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

Parameter

handler
EventHandler<NSNotificationEventArgs>

Metode untuk memanggil saat pemberitahuan diposting.

Mengembalikan

Objek token yang dapat digunakan untuk berhenti menerima pemberitahuan dengan membuangnya atau meneruskannya ke RemoveObservers(IEnumerable<NSObject>)

Keterangan

Metode ini dapat digunakan untuk berlangganan DarkerSystemColorsStatusDidChangeNotification pemberitahuan.

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

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

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

Berlaku untuk