Partager via


UIBarItem.Notifications.ObserveShakeToUndoDidChange Méthode

Définition

Surcharges

ObserveShakeToUndoDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la ShakeToUndoDidChangeNotification constante.

ObserveShakeToUndoDidChange(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la ShakeToUndoDidChangeNotification constante.

ObserveShakeToUndoDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la ShakeToUndoDidChangeNotification constante.

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

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

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

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

S’applique à

ObserveShakeToUndoDidChange(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la ShakeToUndoDidChangeNotification constante.

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

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

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

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

S’applique à