Partager via


WKInterfaceObject.Notifications.ObserveAssistiveTechnologyKey Méthode

Définition

Surcharges

ObserveAssistiveTechnologyKey(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la constante P:WatchKit.WKInterfaceObject.AssistiveTechnologyKeyNotification .

ObserveAssistiveTechnologyKey(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la constante P:WatchKit.WKInterfaceObject.AssistiveTechnologyKeyNotification .

ObserveAssistiveTechnologyKey(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la constante P:WatchKit.WKInterfaceObject.AssistiveTechnologyKeyNotification .

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

Paramètres

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lorsque la notification est publiée.

Retours

Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)

Remarques

Cette méthode peut être utilisée pour s’abonner aux notifications P:WatchKit.WKInterfaceObject.AssistiveTechnologyKeyNotification .

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

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

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

S’applique à

ObserveAssistiveTechnologyKey(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la constante P:WatchKit.WKInterfaceObject.AssistiveTechnologyKeyNotification .

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

Paramètres

objectToObserve
NSObject

Objet à observer.

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lorsque la notification est publiée.

Retours

Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)

Remarques

Cette méthode peut être utilisée pour s’abonner aux notifications P:WatchKit.WKInterfaceObject.AssistiveTechnologyKeyNotification .

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

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

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

S’applique à