Share via


NSWindow.Notifications.ObserveDidExpose Method

Definition

Overloads

Name Description
ObserveDidExpose(EventHandler<NSWindowExposeEventArgs>)

Strongly typed notification for the DidExposeNotification constant.

ObserveDidExpose(NSObject, EventHandler<NSWindowExposeEventArgs>)

Strongly typed notification for the DidExposeNotification constant.

ObserveDidExpose(EventHandler<NSWindowExposeEventArgs>)

Strongly typed notification for the DidExposeNotification constant.

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

Parameters

handler
EventHandler<NSWindowExposeEventArgs>

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

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

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

Applies to

ObserveDidExpose(NSObject, EventHandler<NSWindowExposeEventArgs>)

Strongly typed notification for the DidExposeNotification constant.

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

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<NSWindowExposeEventArgs>

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

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

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

Applies to