Compartilhar via


MPMoviePlayerController.Notifications.ObserveDidExitFullscreen Método

Definição

Sobrecargas

ObserveDidExitFullscreen(EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a DidExitFullscreenNotification constante.

ObserveDidExitFullscreen(NSObject, EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a DidExitFullscreenNotification constante.

ObserveDidExitFullscreen(EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a DidExitFullscreenNotification constante.

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

Parâmetros

handler
EventHandler<NSNotificationEventArgs>

Método a ser invocado quando a notificação é postada.

Retornos

Objeto de token que pode ser usado para parar de receber notificações descartando-o ou passando-o para RemoveObservers(IEnumerable<NSObject>)

Comentários

O exemplo a seguir mostra como você pode usar esse método em seu código

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

Aplica-se a

ObserveDidExitFullscreen(NSObject, EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a DidExitFullscreenNotification constante.

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

Parâmetros

objectToObserve
NSObject

O objeto a ser observado.

handler
EventHandler<NSNotificationEventArgs>

Método a ser invocado quando a notificação é postada.

Retornos

Objeto de token que pode ser usado para parar de receber notificações descartando-o ou passando-o para RemoveObservers(IEnumerable<NSObject>)

Comentários

Esse método pode ser usado para assinar DidExitFullscreenNotification notificações.

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

Aplica-se a