Partager via


MPMoviePlayerController.Notifications.ObserveWillEnterFullscreen Méthode

Définition

Surcharges

ObserveWillEnterFullscreen(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la WillEnterFullscreenNotification constante.

ObserveWillEnterFullscreen(EventHandler<MPMoviePlayerFullScreenEventArgs>)

Notification fortement typée pour la WillEnterFullscreenNotification constante.

ObserveWillEnterFullscreen(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la WillEnterFullscreenNotification constante.

ObserveWillEnterFullscreen(NSObject, EventHandler<MPMoviePlayerFullScreenEventArgs>)

Notification fortement typée pour la WillEnterFullscreenNotification constante.

ObserveWillEnterFullscreen(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la WillEnterFullscreenNotification constante.

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

Paramètres

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lorsque la notification est publiée.

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 les développeurs peuvent utiliser cette méthode dans leur code :

//
// Lambda style
//

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

    Console.WriteLine ("AnimationDuration", args.AnimationDuration);
    Console.WriteLine ("AnimationCurve", args.AnimationCurve);
});

// 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);

    Console.WriteLine ("AnimationDuration", args.AnimationDuration);
    Console.WriteLine ("AnimationCurve", args.AnimationCurve);
}

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

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

S’applique à

ObserveWillEnterFullscreen(EventHandler<MPMoviePlayerFullScreenEventArgs>)

Notification fortement typée pour la WillEnterFullscreenNotification constante.

public static Foundation.NSObject ObserveWillEnterFullscreen (EventHandler<MediaPlayer.MPMoviePlayerFullScreenEventArgs> handler);
static member ObserveWillEnterFullscreen : EventHandler<MediaPlayer.MPMoviePlayerFullScreenEventArgs> -> Foundation.NSObject

Paramètres

handler
EventHandler<MPMoviePlayerFullScreenEventArgs>

Méthode à appeler lorsque la notification est publiée.

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 WillEnterFullscreenNotification s’abonner aux notifications.

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

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

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

S’applique à

ObserveWillEnterFullscreen(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la WillEnterFullscreenNotification constante.

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

Paramètres

objectToObserve
NSObject

Objet à observer.

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lorsque la notification est publiée.

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 WillEnterFullscreenNotification s’abonner aux notifications.

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

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

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

S’applique à

ObserveWillEnterFullscreen(NSObject, EventHandler<MPMoviePlayerFullScreenEventArgs>)

Notification fortement typée pour la WillEnterFullscreenNotification constante.

public static Foundation.NSObject ObserveWillEnterFullscreen (Foundation.NSObject objectToObserve, EventHandler<MediaPlayer.MPMoviePlayerFullScreenEventArgs> handler);
static member ObserveWillEnterFullscreen : Foundation.NSObject * EventHandler<MediaPlayer.MPMoviePlayerFullScreenEventArgs> -> Foundation.NSObject

Paramètres

objectToObserve
NSObject

Objet à observer.

handler
EventHandler<MPMoviePlayerFullScreenEventArgs>

Méthode à appeler lorsque la notification est publiée.

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 WillEnterFullscreenNotification s’abonner aux notifications.

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

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

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

S’applique à