Поделиться через


UIScreen.Notifications.ObserveCapturedDidChange Метод

Определение

Перегрузки

ObserveCapturedDidChange(EventHandler<NSNotificationEventArgs>)

Строго типизированное уведомление для константы CapturedDidChangeNotification .

ObserveCapturedDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Строго типизированное уведомление для константы CapturedDidChangeNotification .

ObserveCapturedDidChange(EventHandler<NSNotificationEventArgs>)

Строго типизированное уведомление для константы CapturedDidChangeNotification .

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

Параметры

handler
EventHandler<NSNotificationEventArgs>

Метод, вызываемый при публикации уведомления.

Возвращаемое значение

Объект токена, который можно использовать для прекращения получения уведомлений путем удаления или передачи в RemoveObservers(IEnumerable<NSObject>)

Комментарии

Этот метод можно использовать для подписки на CapturedDidChangeNotification уведомления.

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

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

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

Применяется к

ObserveCapturedDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Строго типизированное уведомление для константы CapturedDidChangeNotification .

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

Параметры

objectToObserve
NSObject

Объект для наблюдения.

handler
EventHandler<NSNotificationEventArgs>

Метод, вызываемый при публикации уведомления.

Возвращаемое значение

Объект токена, который можно использовать для прекращения получения уведомлений путем удаления или передачи в RemoveObservers(IEnumerable<NSObject>)

Комментарии

Этот метод можно использовать для подписки на CapturedDidChangeNotification уведомления.

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

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

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

Применяется к