UIScreen.Notifications.ObserveCapturedDidChange メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
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 ();