Edytuj

Udostępnij za pośrednictwem


PdfView.Notifications.ObserveDisplayBoxChanged Method

Definition

Overloads

ObserveDisplayBoxChanged(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the DisplayBoxChangedNotification constant.

ObserveDisplayBoxChanged(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the DisplayBoxChangedNotification constant.

ObserveDisplayBoxChanged(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the DisplayBoxChangedNotification constant.

public static Foundation.NSObject ObserveDisplayBoxChanged (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveDisplayBoxChanged : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject

Parameters

handler
EventHandler<NSNotificationEventArgs>

Method to invoke when the notification is posted.

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 for DisplayBoxChangedNotification notifications.

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

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

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

Applies to

ObserveDisplayBoxChanged(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the DisplayBoxChangedNotification constant.

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

Parameters

objectToObserve
NSObject

The object to observe.

handler
EventHandler<NSNotificationEventArgs>

Method to invoke when the notification is posted.

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 for DisplayBoxChangedNotification notifications.

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

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

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

Applies to