Share via


NSText.Notifications.ObserveDidEndEditing Method

Definition

Overloads

ObserveDidEndEditing(EventHandler<NSTextDidEndEditingEventArgs>)

Strongly typed notification for the DidEndEditingNotification constant.

public static Foundation.NSObject ObserveDidEndEditing(EventHandler<AppKit.NSTextDidEndEditingEventArgs> handler);
static member ObserveDidEndEditing : EventHandler<AppKit.NSTextDidEndEditingEventArgs> -> Foundation.NSObject

Parameters

handler
EventHandler<NSTextDidEndEditingEventArgs>

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>).

Remarks

This method can be used to subscribe to DidEndEditingNotification notifications.

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

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

Applies to

ObserveDidEndEditing(NSObject, EventHandler<NSTextDidEndEditingEventArgs>)

Strongly typed notification for the DidEndEditingNotification constant.

public static Foundation.NSObject ObserveDidEndEditing(Foundation.NSObject objectToObserve, EventHandler<AppKit.NSTextDidEndEditingEventArgs> handler);
static member ObserveDidEndEditing : Foundation.NSObject * EventHandler<AppKit.NSTextDidEndEditingEventArgs> -> Foundation.NSObject

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<NSTextDidEndEditingEventArgs>

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>).

Remarks

This method can be used to subscribe to DidEndEditingNotification notifications.

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

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

Applies to