Partager via


WKInterfaceObject.Notifications.ObserveVoiceOverStatusDidChange Méthode

Définition

Surcharges

ObserveVoiceOverStatusDidChange(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la VoiceOverStatusDidChangeNotification constante.

public static Foundation.NSObject ObserveVoiceOverStatusDidChange(EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveVoiceOverStatusDidChange : 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 VoiceOverStatusDidChangeNotification s’abonner aux notifications.

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

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

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

S’applique à

ObserveVoiceOverStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la VoiceOverStatusDidChangeNotification constante.

public static Foundation.NSObject ObserveVoiceOverStatusDidChange(Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveVoiceOverStatusDidChange : 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 VoiceOverStatusDidChangeNotification s’abonner aux notifications.

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

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

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

S’applique à