Compartilhar via


UIView.Notifications.ObserveInvertColorsStatusDidChange Método

Definição

Sobrecargas

ObserveInvertColorsStatusDidChange(EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a InvertColorsStatusDidChangeNotification constante.

ObserveInvertColorsStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a InvertColorsStatusDidChangeNotification constante.

ObserveInvertColorsStatusDidChange(EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a InvertColorsStatusDidChangeNotification constante.

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

Parâmetros

handler
EventHandler<NSNotificationEventArgs>

Método a ser invocado quando a notificação é postada.

Retornos

Objeto de token que pode ser usado para parar de receber notificações descartando-o ou passando-o para RemoveObservers(IEnumerable<NSObject>)

Comentários

Esse método pode ser usado para assinar InvertColorsStatusDidChangeNotification notificações.

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

Aplica-se a

ObserveInvertColorsStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a InvertColorsStatusDidChangeNotification constante.

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

Parâmetros

objectToObserve
NSObject

O objeto a ser observado.

handler
EventHandler<NSNotificationEventArgs>

Método a ser invocado quando a notificação é postada.

Retornos

Objeto de token que pode ser usado para parar de receber notificações descartando-o ou passando-o para RemoveObservers(IEnumerable<NSObject>)

Comentários

Esse método pode ser usado para assinar InvertColorsStatusDidChangeNotification notificações.

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

Aplica-se a