Edytuj

Udostępnij za pośrednictwem


UIView.Notifications.ObserveSpeakSelectionStatusDidChange Method

Definition

Overloads

ObserveSpeakSelectionStatusDidChange(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the SpeakSelectionStatusDidChangeNotification constant.

ObserveSpeakSelectionStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the SpeakSelectionStatusDidChangeNotification constant.

ObserveSpeakSelectionStatusDidChange(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the SpeakSelectionStatusDidChangeNotification constant.

public static Foundation.NSObject ObserveSpeakSelectionStatusDidChange (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveSpeakSelectionStatusDidChange : 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

This method can be used to subscribe for SpeakSelectionStatusDidChangeNotification notifications.

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

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

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

Applies to

ObserveSpeakSelectionStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the SpeakSelectionStatusDidChangeNotification constant.

public static Foundation.NSObject ObserveSpeakSelectionStatusDidChange (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveSpeakSelectionStatusDidChange : 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 SpeakSelectionStatusDidChangeNotification notifications.

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

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

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

Applies to