Compartilhar via


WKInterfaceObject.Notifications.ObserveUnfocusedElementKey Método

Definição

Sobrecargas

ObserveUnfocusedElementKey(EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a constante P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification .

ObserveUnfocusedElementKey(NSObject, EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a constante P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification .

ObserveUnfocusedElementKey(EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a 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 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 notificações 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 ();

Aplica-se a

ObserveUnfocusedElementKey(NSObject, EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a 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

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 notificações 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 ();

Aplica-se a