Partager via


MPMoviePlayerController.Notifications.ObserveDidExitFullscreen Méthode

Définition

Surcharges

ObserveDidExitFullscreen(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DidExitFullscreenNotification constante.

ObserveDidExitFullscreen(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DidExitFullscreenNotification constante.

ObserveDidExitFullscreen(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DidExitFullscreenNotification constante.

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

Paramètres

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lors de la publication de la notification.

Retours

Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)

Remarques

L’exemple suivant montre comment utiliser cette méthode dans votre code

//
// Lambda style
//

// listening
notification = MPMoviePlayerController.Notifications.ObserveDidExitFullscreen ((sender, args) => {
    /* Access strongly typed args */
    Console.WriteLine ("Notification: {0}", args.Notification);
});

// To stop listening:
notification.Dispose ();

//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
    // Access strongly typed args
    Console.WriteLine ("Notification: {0}", args.Notification);
}

void Setup ()
{
    notification = MPMoviePlayerController.Notifications.ObserveDidExitFullscreen (Callback);
}

void Teardown ()
{
    notification.Dispose ();
}

S’applique à

ObserveDidExitFullscreen(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DidExitFullscreenNotification constante.

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

Paramètres

objectToObserve
NSObject

Objet à observer.

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lors de la publication de la notification.

Retours

Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)

Remarques

Cette méthode peut être utilisée pour DidExitFullscreenNotification s’abonner aux notifications.

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

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

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

S’applique à