MLModelCollection.Notifications.ObserveDidChange Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| ObserveDidChange(EventHandler<NSNotificationEventArgs>) |
Obsolete.
This method does nothing, and only returns a placeholder instance. |
| ObserveDidChange(NSObject, EventHandler<NSNotificationEventArgs>) |
Obsolete.
This method does nothing, and only returns a placerholder instance. |
ObserveDidChange(EventHandler<NSNotificationEventArgs>)
Caution
This method does nothing.
This method does nothing, and only returns a placeholder instance.
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
Parameters
- handler
- EventHandler<NSNotificationEventArgs>
The handler that responds to the notification when it occurs.
Returns
Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).
- Attributes
Remarks
This method can be used to subscribe to 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 ();
Applies to
ObserveDidChange(NSObject, EventHandler<NSNotificationEventArgs>)
Caution
This method does nothing.
This method does nothing, and only returns a placerholder instance.
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
Parameters
- objectToObserve
- NSObject
The specific object to observe.
- handler
- EventHandler<NSNotificationEventArgs>
The handler that responds to the notification when it occurs.
Returns
Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).
- Attributes
Remarks
This method can be used to subscribe to 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 ();