WKInterfaceObject.Notifications.ObserveUnfocusedElementKey Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Sobrecargas
| ObserveUnfocusedElementKey(EventHandler<NSNotificationEventArgs>) |
Notificación fuertemente tipada para la constante P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification . |
| ObserveUnfocusedElementKey(NSObject, EventHandler<NSNotificationEventArgs>) |
Notificación fuertemente tipada para la constante P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification . |
ObserveUnfocusedElementKey(EventHandler<NSNotificationEventArgs>)
Notificación fuertemente tipada para la constante P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification .
public static Foundation.NSObject ObserveUnfocusedElementKey(EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveUnfocusedElementKey : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject
Parámetros
- handler
- EventHandler<NSNotificationEventArgs>
Método que se invoca cuando se publica la notificación.
Devoluciones
Objeto token que se puede usar para dejar de recibir notificaciones mediante su eliminación o su paso a RemoveObservers(IEnumerable<NSObject>)
Comentarios
Este método se puede usar para suscribirse a las notificaciones P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification .
// Listen to all notifications posted for any object
var token = WKInterfaceObject.Notifications.ObserveUnfocusedElementKey ((notification) => {
Console.WriteLine ("Observed UnfocusedElementKeyNotification!");
};
// Listen to all notifications posted for a single object
var token = WKInterfaceObject.Notifications.ObserveUnfocusedElementKey (objectToObserve, (notification) => {
Console.WriteLine ($"Observed UnfocusedElementKeyNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
Se aplica a
ObserveUnfocusedElementKey(NSObject, EventHandler<NSNotificationEventArgs>)
Notificación fuertemente tipada para la constante P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification .
public static Foundation.NSObject ObserveUnfocusedElementKey(Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveUnfocusedElementKey : Foundation.NSObject * EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject
Parámetros
- objectToObserve
- NSObject
Objeto que se va a observar.
- handler
- EventHandler<NSNotificationEventArgs>
Método que se invoca cuando se publica la notificación.
Devoluciones
Objeto token que se puede usar para dejar de recibir notificaciones mediante su eliminación o su paso a RemoveObservers(IEnumerable<NSObject>)
Comentarios
Este método se puede usar para suscribirse a las notificaciones P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification .
// Listen to all notifications posted for any object
var token = WKInterfaceObject.Notifications.ObserveUnfocusedElementKey ((notification) => {
Console.WriteLine ("Observed UnfocusedElementKeyNotification!");
};
// Listen to all notifications posted for a single object
var token = WKInterfaceObject.Notifications.ObserveUnfocusedElementKey (objectToObserve, (notification) => {
Console.WriteLine ($"Observed UnfocusedElementKeyNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();