Compartir a través de


WKInterfaceObject.Notifications.ObserveShakeToUndoDidChange Método

Definición

Sobrecargas

ObserveShakeToUndoDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la ShakeToUndoDidChangeNotification constante.

public static Foundation.NSObject ObserveShakeToUndoDidChange(Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveShakeToUndoDidChange : 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 ShakeToUndoDidChangeNotification a las notificaciones.

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

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

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

Se aplica a

ObserveShakeToUndoDidChange(EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la ShakeToUndoDidChangeNotification constante.

public static Foundation.NSObject ObserveShakeToUndoDidChange(EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveShakeToUndoDidChange : 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 ShakeToUndoDidChangeNotification a las notificaciones.

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

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

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

Se aplica a