編輯

共用方式為


UIImage.Notifications.ObserveVoiceOverStatusDidChange Method

Definition

Overloads

ObserveVoiceOverStatusDidChange(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the VoiceOverStatusDidChangeNotification constant.

ObserveVoiceOverStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the VoiceOverStatusDidChangeNotification constant.

ObserveVoiceOverStatusDidChange(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the VoiceOverStatusDidChangeNotification constant.

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

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

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

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

Applies to

ObserveVoiceOverStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the VoiceOverStatusDidChangeNotification constant.

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

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

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

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

Applies to