UIBarItem.Notifications.ObserveGrayscaleStatusDidChange Método

Definición

Sobrecargas

ObserveGrayscaleStatusDidChange(EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la GrayscaleStatusDidChangeNotification constante.

ObserveGrayscaleStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la GrayscaleStatusDidChangeNotification constante.

ObserveGrayscaleStatusDidChange(EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la GrayscaleStatusDidChangeNotification constante.

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

Parámetros

handler
EventHandler<NSNotificationEventArgs>

Método para invocar cuando se publica la notificación.

Devoluciones

Objeto de token que se puede usar para dejar de recibir notificaciones al eliminarlo o pasarlo a RemoveObservers(IEnumerable<NSObject>)

Comentarios

Este método se puede usar para suscribirse GrayscaleStatusDidChangeNotification a las notificaciones.

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

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

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

Se aplica a

ObserveGrayscaleStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la GrayscaleStatusDidChangeNotification constante.

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

Parámetros

objectToObserve
NSObject

Objeto que se va a observar.

handler
EventHandler<NSNotificationEventArgs>

Método para invocar cuando se publica la notificación.

Devoluciones

Objeto de token que se puede usar para dejar de recibir notificaciones al eliminarlo o pasarlo a RemoveObservers(IEnumerable<NSObject>)

Comentarios

Este método se puede usar para suscribirse GrayscaleStatusDidChangeNotification a las notificaciones.

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

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

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

Se aplica a