Share via


NSAnimation.Notifications.ObserveProgressMark Method

Definition

Overloads

ObserveProgressMark(EventHandler<NSAnimationProgressMarkEventArgs>)

Strongly typed notification for the ProgressMarkNotification constant.

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

Parameters

handler
EventHandler<NSAnimationProgressMarkEventArgs>

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

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

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

Applies to

ObserveProgressMark(NSObject, EventHandler<NSAnimationProgressMarkEventArgs>)

Strongly typed notification for the ProgressMarkNotification constant.

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

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<NSAnimationProgressMarkEventArgs>

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

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

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

Applies to