Share via


NSOutlineView.Notifications.ObserveItemDidExpand Method

Definition

Overloads

ObserveItemDidExpand(EventHandler<NSOutlineViewItemEventArgs>)

Strongly typed notification for the ItemDidExpandNotification constant.

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

Parameters

handler
EventHandler<NSOutlineViewItemEventArgs>

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

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

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

Applies to

ObserveItemDidExpand(NSObject, EventHandler<NSOutlineViewItemEventArgs>)

Strongly typed notification for the ItemDidExpandNotification constant.

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

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<NSOutlineViewItemEventArgs>

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

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

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

Applies to