MLModelCollection.Notifications.ObserveDidChange Méthode

Définition

Surcharges

Nom Description
ObserveDidChange(EventHandler<NSNotificationEventArgs>)
Obsolète.

Cette méthode ne fait rien et retourne uniquement une instance d’espace réservé.

ObserveDidChange(NSObject, EventHandler<NSNotificationEventArgs>)
Obsolète.

Cette méthode ne fait rien et retourne uniquement une instance d’espace réservé.

ObserveDidChange(EventHandler<NSNotificationEventArgs>)

Attention

This method does nothing.

Cette méthode ne fait rien et retourne uniquement une instance d’espace réservé.

public static Foundation.NSObject ObserveDidChange(EventHandler<Foundation.NSNotificationEventArgs> handler);
[System.Obsolete("This method does nothing.")]
public static Foundation.NSObject ObserveDidChange(EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveDidChange : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject
[<System.Obsolete("This method does nothing.")>]
static member ObserveDidChange : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject

Paramètres

handler
EventHandler<NSNotificationEventArgs>

Gestionnaire qui répond à la notification lorsqu’elle se produit.

Retours

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

Attributs

Remarques

Cette méthode peut être utilisée pour s’abonner aux DidChangeNotification notifications.

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

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

S’applique à

ObserveDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Attention

This method does nothing.

Cette méthode ne fait rien et retourne uniquement une instance d’espace réservé.

public static Foundation.NSObject ObserveDidChange(Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
[System.Obsolete("This method does nothing.")]
public static Foundation.NSObject ObserveDidChange(Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveDidChange : Foundation.NSObject * EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject
[<System.Obsolete("This method does nothing.")>]
static member ObserveDidChange : Foundation.NSObject * EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject

Paramètres

objectToObserve
NSObject

Objet spécifique à observer.

handler
EventHandler<NSNotificationEventArgs>

Gestionnaire qui répond à la notification lorsqu’elle se produit.

Retours

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

Attributs

Remarques

Cette méthode peut être utilisée pour s’abonner aux DidChangeNotification notifications.

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

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

S’applique à