Share via


AVAudioSession.Notifications.ObserveSpatialPlaybackCapabilitiesChanged Method

Definition

Overloads

ObserveSpatialPlaybackCapabilitiesChanged(EventHandler<SpatialPlaybackCapabilitiesChangedEventArgs>)

Strongly typed notification for the SpatialPlaybackCapabilitiesChangedNotification constant.

public static Foundation.NSObject ObserveSpatialPlaybackCapabilitiesChanged(EventHandler<AVFoundation.SpatialPlaybackCapabilitiesChangedEventArgs> handler);
static member ObserveSpatialPlaybackCapabilitiesChanged : EventHandler<AVFoundation.SpatialPlaybackCapabilitiesChangedEventArgs> -> Foundation.NSObject

Parameters

handler
EventHandler<SpatialPlaybackCapabilitiesChangedEventArgs>

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

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

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

Applies to

ObserveSpatialPlaybackCapabilitiesChanged(NSObject, EventHandler<SpatialPlaybackCapabilitiesChangedEventArgs>)

Strongly typed notification for the SpatialPlaybackCapabilitiesChangedNotification constant.

public static Foundation.NSObject ObserveSpatialPlaybackCapabilitiesChanged(Foundation.NSObject objectToObserve, EventHandler<AVFoundation.SpatialPlaybackCapabilitiesChangedEventArgs> handler);
static member ObserveSpatialPlaybackCapabilitiesChanged : Foundation.NSObject * EventHandler<AVFoundation.SpatialPlaybackCapabilitiesChangedEventArgs> -> Foundation.NSObject

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<SpatialPlaybackCapabilitiesChangedEventArgs>

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

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

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

Applies to