Edit

Share via


MPMoviePlayerController.Notifications.ObserveMPMoviePlayerIsAirPlayVideoActiveDidChange Method

Definition

Overloads

ObserveMPMoviePlayerIsAirPlayVideoActiveDidChange(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the MPMoviePlayerIsAirPlayVideoActiveDidChangeNotification constant.

C#
public static Foundation.NSObject ObserveMPMoviePlayerIsAirPlayVideoActiveDidChange(EventHandler<Foundation.NSNotificationEventArgs> handler);

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

This method can be used to subscribe for MPMoviePlayerIsAirPlayVideoActiveDidChangeNotification notifications.

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

// Listen to all notifications posted for a single object
var token = MPMoviePlayerController.Notifications.ObserveMPMoviePlayerIsAirPlayVideoActiveDidChange (objectToObserve, (notification) => {
	Console.WriteLine ($"Observed MPMoviePlayerIsAirPlayVideoActiveDidChangeNotification for {nameof (objectToObserve)}!");
};

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

Applies to

Xamarin iOS SDK 12
Product Versions
Xamarin iOS SDK 12

ObserveMPMoviePlayerIsAirPlayVideoActiveDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the MPMoviePlayerIsAirPlayVideoActiveDidChangeNotification constant.

C#
public static Foundation.NSObject ObserveMPMoviePlayerIsAirPlayVideoActiveDidChange(Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);

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 MPMoviePlayerIsAirPlayVideoActiveDidChangeNotification notifications.

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

// Listen to all notifications posted for a single object
var token = MPMoviePlayerController.Notifications.ObserveMPMoviePlayerIsAirPlayVideoActiveDidChange (objectToObserve, (notification) => {
	Console.WriteLine ($"Observed MPMoviePlayerIsAirPlayVideoActiveDidChangeNotification for {nameof (objectToObserve)}!");
};

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

Applies to

Xamarin iOS SDK 12
Product Versions
Xamarin iOS SDK 12