UIImage.Notifications.ObserveFocusedElementKey Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Overload
ObserveFocusedElementKey(EventHandler<NSNotificationEventArgs>) |
Pemberitahuan yang diketik dengan kuat untuk P:UIKit.UIImage.FocusedElementKeyNotification . |
ObserveFocusedElementKey(NSObject, EventHandler<NSNotificationEventArgs>) |
Pemberitahuan yang diketik dengan kuat untuk P:UIKit.UIImage.FocusedElementKeyNotification . |
ObserveFocusedElementKey(EventHandler<NSNotificationEventArgs>)
Pemberitahuan yang diketik dengan kuat untuk P:UIKit.UIImage.FocusedElementKeyNotification .
public static Foundation.NSObject ObserveFocusedElementKey (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveFocusedElementKey : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject
Parameter
- handler
- EventHandler<NSNotificationEventArgs>
Metode untuk memanggil saat pemberitahuan diposting.
Mengembalikan
Objek token yang dapat digunakan untuk berhenti menerima pemberitahuan dengan membuangnya atau meneruskannya ke RemoveObservers(IEnumerable<NSObject>)
Keterangan
Metode ini dapat digunakan untuk berlangganan pemberitahuan P:UIKit.UIImage.FocusedElementKeyNotification .
// Listen to all notifications posted for any object
var token = UIImage.Notifications.ObserveFocusedElementKey ((notification) => {
Console.WriteLine ("Observed FocusedElementKeyNotification!");
};
// Listen to all notifications posted for a single object
var token = UIImage.Notifications.ObserveFocusedElementKey (objectToObserve, (notification) => {
Console.WriteLine ($"Observed FocusedElementKeyNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
Berlaku untuk
ObserveFocusedElementKey(NSObject, EventHandler<NSNotificationEventArgs>)
Pemberitahuan yang diketik dengan kuat untuk P:UIKit.UIImage.FocusedElementKeyNotification .
public static Foundation.NSObject ObserveFocusedElementKey (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveFocusedElementKey : Foundation.NSObject * EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject
Parameter
- objectToObserve
- NSObject
Objek yang akan diamati.
- handler
- EventHandler<NSNotificationEventArgs>
Metode untuk memanggil saat pemberitahuan diposting.
Mengembalikan
Objek token yang dapat digunakan untuk berhenti menerima pemberitahuan dengan membuangnya atau meneruskannya ke RemoveObservers(IEnumerable<NSObject>)
Keterangan
Metode ini dapat digunakan untuk berlangganan pemberitahuan P:UIKit.UIImage.FocusedElementKeyNotification .
// Listen to all notifications posted for any object
var token = UIImage.Notifications.ObserveFocusedElementKey ((notification) => {
Console.WriteLine ("Observed FocusedElementKeyNotification!");
};
// Listen to all notifications posted for a single object
var token = UIImage.Notifications.ObserveFocusedElementKey (objectToObserve, (notification) => {
Console.WriteLine ($"Observed FocusedElementKeyNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();