MPMoviePlayerController.Notifications.ObserveWillEnterFullscreen Method

Definition

Overloads

ObserveWillEnterFullscreen(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the WillEnterFullscreenNotification constant.

ObserveWillEnterFullscreen(EventHandler<MPMoviePlayerFullScreenEventArgs>)

Strongly typed notification for the WillEnterFullscreenNotification constant.

ObserveWillEnterFullscreen(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the WillEnterFullscreenNotification constant.

ObserveWillEnterFullscreen(NSObject, EventHandler<MPMoviePlayerFullScreenEventArgs>)

Strongly typed notification for the WillEnterFullscreenNotification constant.

ObserveWillEnterFullscreen(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the WillEnterFullscreenNotification constant.

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

Parameters

handler
EventHandler<NSNotificationEventArgs>

Method to invoke when the notification is posted.

Returns

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

Remarks

The following example shows how developers can use this method in their 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 ();
}

Applies to

ObserveWillEnterFullscreen(EventHandler<MPMoviePlayerFullScreenEventArgs>)

Strongly typed notification for the WillEnterFullscreenNotification constant.

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

Parameters

handler
EventHandler<MPMoviePlayerFullScreenEventArgs>

Method to invoke when the notification is posted.

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 for WillEnterFullscreenNotification 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 ();

Applies to

ObserveWillEnterFullscreen(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the WillEnterFullscreenNotification constant.

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

Parameters

objectToObserve
NSObject

The object to observe.

handler
EventHandler<NSNotificationEventArgs>

Method to invoke when the notification is posted.

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 for WillEnterFullscreenNotification 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 ();

Applies to

ObserveWillEnterFullscreen(NSObject, EventHandler<MPMoviePlayerFullScreenEventArgs>)

Strongly typed notification for the WillEnterFullscreenNotification constant.

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

Parameters

objectToObserve
NSObject

The object to observe.

handler
EventHandler<MPMoviePlayerFullScreenEventArgs>

Method to invoke when the notification is posted.

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 for WillEnterFullscreenNotification 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 ();

Applies to