Edit

Share via


AVAssetTrack.Notifications.ObserveTrackAssociationsDidChange Method

Definition

Overloads

ObserveTrackAssociationsDidChange(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the TrackAssociationsDidChangeNotification constant.

ObserveTrackAssociationsDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the TrackAssociationsDidChangeNotification constant.

ObserveTrackAssociationsDidChange(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the TrackAssociationsDidChangeNotification constant.

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

Parameters

handler
EventHandler<NSNotificationEventArgs>

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 for TrackAssociationsDidChangeNotification notifications.

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

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

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

Applies to

ObserveTrackAssociationsDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the TrackAssociationsDidChangeNotification constant.

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

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<NSNotificationEventArgs>

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 for TrackAssociationsDidChangeNotification notifications.

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

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

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

Applies to