Condividi tramite


PdfView.Notifications.ObservePageChanged Metodo

Definizione

Overload

ObservePageChanged(EventHandler<NSNotificationEventArgs>)

Notifica fortemente tipizzata per la PageChangedNotification costante.

ObservePageChanged(NSObject, EventHandler<NSNotificationEventArgs>)

Notifica fortemente tipizzata per la PageChangedNotification costante.

ObservePageChanged(EventHandler<NSNotificationEventArgs>)

Notifica fortemente tipizzata per la PageChangedNotification costante.

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

Parametri

handler
EventHandler<NSNotificationEventArgs>

Metodo da richiamare quando viene pubblicata la notifica.

Restituisce

Oggetto token che può essere usato per arrestare la ricezione delle notifiche eliminandolo o passandolo a RemoveObservers(IEnumerable<NSObject>)

Commenti

Questo metodo può essere usato per sottoscrivere PageChangedNotification le notifiche.

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

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

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

Si applica a

ObservePageChanged(NSObject, EventHandler<NSNotificationEventArgs>)

Notifica fortemente tipizzata per la PageChangedNotification costante.

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

Parametri

objectToObserve
NSObject

Oggetto da osservare.

handler
EventHandler<NSNotificationEventArgs>

Metodo da richiamare quando viene pubblicata la notifica.

Restituisce

Oggetto token che può essere usato per arrestare la ricezione delle notifiche eliminandolo o passandolo a RemoveObservers(IEnumerable<NSObject>)

Commenti

Questo metodo può essere usato per sottoscrivere PageChangedNotification le notifiche.

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

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

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

Si applica a