MPMoviePlayerController.Notifications.ObserveWillExitFullscreen Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Sobrecargas
ObserveWillExitFullscreen(EventHandler<MPMoviePlayerFullScreenEventArgs>) |
Notificação fortemente tipada para a WillExitFullscreenNotification constante. |
ObserveWillExitFullscreen(NSObject, EventHandler<MPMoviePlayerFullScreenEventArgs>) |
Notificação fortemente tipada para a WillExitFullscreenNotification constante. |
ObserveWillExitFullscreen(EventHandler<MPMoviePlayerFullScreenEventArgs>)
Notificação fortemente tipada para a WillExitFullscreenNotification constante.
public static Foundation.NSObject ObserveWillExitFullscreen (EventHandler<MediaPlayer.MPMoviePlayerFullScreenEventArgs> handler);
static member ObserveWillExitFullscreen : EventHandler<MediaPlayer.MPMoviePlayerFullScreenEventArgs> -> Foundation.NSObject
Parâmetros
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 os desenvolvedores podem usar esse método em seu código:
//
// 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 ();
}
Aplica-se a
ObserveWillExitFullscreen(NSObject, EventHandler<MPMoviePlayerFullScreenEventArgs>)
Notificação fortemente tipada para a WillExitFullscreenNotification constante.
public static Foundation.NSObject ObserveWillExitFullscreen (Foundation.NSObject objectToObserve, EventHandler<MediaPlayer.MPMoviePlayerFullScreenEventArgs> handler);
static member ObserveWillExitFullscreen : Foundation.NSObject * EventHandler<MediaPlayer.MPMoviePlayerFullScreenEventArgs> -> Foundation.NSObject
Parâmetros
- objectToObserve
- NSObject
O objeto a ser observado.
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 WillExitFullscreenNotification notificações.
// Listen to all notifications posted for any object
var token = MPMoviePlayerController.Notifications.ObserveWillExitFullscreen ((notification) => {
Console.WriteLine ("Observed WillExitFullscreenNotification!");
};
// Listen to all notifications posted for a single object
var token = MPMoviePlayerController.Notifications.ObserveWillExitFullscreen (objectToObserve, (notification) => {
Console.WriteLine ($"Observed WillExitFullscreenNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();