Share via


MPMoviePlayerController.WillExitFullscreenNotification Propiedad

Definición

Constante de notificación para WillExitFullscreen

[Foundation.Advice("Use MPMoviePlayerController.Notifications.ObserveWillExitFullscreen helper method instead.")]
[Foundation.Field("MPMoviePlayerWillExitFullscreenNotification", "MediaPlayer")]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, "Use 'AVPlayerViewController' (AVKit) instead.")]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public static Foundation.NSString WillExitFullscreenNotification { [ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, "Use 'AVPlayerViewController' (AVKit) instead.")] [ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.WillExitFullscreenNotification : Foundation.NSString

Valor de propiedad

La constante NSString se debe usar como token para NSNotificationCenter.

Atributos

Comentarios

Esta constante se puede usar con para NSNotificationCenter registrar un agente de escucha para esta notificación. Se trata de un NSString en lugar de una cadena, ya que estos valores se pueden usar como tokens en algunas bibliotecas nativas en lugar de usarse exclusivamente para su contenido de cadena real. El parámetro "notification" de la devolución de llamada contiene información adicional específica del tipo de notificación.

Para suscribirse a esta notificación, los desarrolladores pueden usar el método de conveniencia MPMoviePlayerController.Notifications.ObserveWillExitFullscreen que ofrece acceso fuertemente tipado a los parámetros de la notificación.

En el ejemplo siguiente se muestra cómo usar la clase Notifications fuertemente tipada, para quitar la estimación de las propiedades disponibles en la notificación:

//
// Lambda style
//

// listening
notification = MPMoviePlayerController.Notifications.ObserveWillExitFullscreen ((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, MediaPlayer.MPMoviePlayerFullScreenEventArgs 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.ObserveWillExitFullscreen (Callback);
}

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

En el ejemplo siguiente se muestra cómo usar la notificación con DefaultCenter API:

// Lambda style
NSNotificationCenter.DefaultCenter.AddObserver (
        MPMoviePlayerController.WillExitFullscreenNotification, (notification) => {Console.WriteLine ("Received the notification MPMoviePlayerController", notification); }


// Method style
void Callback (NSNotification notification)
{
    Console.WriteLine ("Received a notification MPMoviePlayerController", notification);
}

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (MPMoviePlayerController.WillExitFullscreenNotification, Callback);
}

Se aplica a