Share via


NSUndoManager.Notifications.ObserveDidCloseUndoGroup Method

Definition

Overloads

ObserveDidCloseUndoGroup(EventHandler<NSUndoManagerCloseUndoGroupEventArgs>)

Strongly typed notification for the DidCloseUndoGroupNotification constant.

public static Foundation.NSObject ObserveDidCloseUndoGroup(EventHandler<Foundation.NSUndoManagerCloseUndoGroupEventArgs> handler);
static member ObserveDidCloseUndoGroup : EventHandler<Foundation.NSUndoManagerCloseUndoGroupEventArgs> -> Foundation.NSObject

Parameters

handler
EventHandler<NSUndoManagerCloseUndoGroupEventArgs>

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 DidCloseUndoGroupNotification notifications.

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

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

Applies to

ObserveDidCloseUndoGroup(NSObject, EventHandler<NSUndoManagerCloseUndoGroupEventArgs>)

Strongly typed notification for the DidCloseUndoGroupNotification constant.

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

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<NSUndoManagerCloseUndoGroupEventArgs>

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 DidCloseUndoGroupNotification notifications.

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

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

Applies to