Share via


MPMoviePlayerController.Notifications.ObserveWillExitFullscreen Method

Definition

Overloads

ObserveWillExitFullscreen(EventHandler<MPMoviePlayerFullScreenEventArgs>)

Strongly typed notification for the WillExitFullscreenNotification constant.

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

Parameters

handler
EventHandler<MPMoviePlayerFullScreenEventArgs>

The handler that responds to the notification when it occurs.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).

Remarks

This method can be used to subscribe to WillExitFullscreenNotification notifications.

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

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

Applies to

ObserveWillExitFullscreen(NSObject, EventHandler<MPMoviePlayerFullScreenEventArgs>)

Strongly typed notification for the WillExitFullscreenNotification constant.

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

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<MPMoviePlayerFullScreenEventArgs>

The handler that responds to the notification when it occurs.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).

Remarks

This method can be used to subscribe to WillExitFullscreenNotification notifications.

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

Applies to