Partager via


UIBarItem.Notifications.ObserveSpeakSelectionStatusDidChange Méthode

Définition

Surcharges

ObserveSpeakSelectionStatusDidChange(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la SpeakSelectionStatusDidChangeNotification constante.

ObserveSpeakSelectionStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la SpeakSelectionStatusDidChangeNotification constante.

ObserveSpeakSelectionStatusDidChange(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la SpeakSelectionStatusDidChangeNotification constante.

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

Paramètres

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lors de la publication de la notification.

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 SpeakSelectionStatusDidChangeNotification s’abonner aux notifications.

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

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

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

S’applique à

ObserveSpeakSelectionStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la SpeakSelectionStatusDidChangeNotification constante.

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

Paramètres

objectToObserve
NSObject

Objet à observer.

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lors de la publication de la notification.

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 SpeakSelectionStatusDidChangeNotification s’abonner aux notifications.

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

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

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

S’applique à