WKInterfaceObject.Notifications.ObserveUnfocusedElementKey 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
ObserveUnfocusedElementKey(EventHandler<NSNotificationEventArgs>) |
Pemberitahuan yang diketik dengan kuat untuk P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification . |
ObserveUnfocusedElementKey(NSObject, EventHandler<NSNotificationEventArgs>) |
Pemberitahuan yang diketik dengan kuat untuk P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification . |
ObserveUnfocusedElementKey(EventHandler<NSNotificationEventArgs>)
Pemberitahuan yang diketik dengan kuat untuk P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification .
public static Foundation.NSObject ObserveUnfocusedElementKey (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveUnfocusedElementKey : 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 P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification .
// Listen to all notifications posted for any object
var token = WKInterfaceObject.Notifications.ObserveUnfocusedElementKey ((notification) => {
Console.WriteLine ("Observed UnfocusedElementKeyNotification!");
};
// Listen to all notifications posted for a single object
var token = WKInterfaceObject.Notifications.ObserveUnfocusedElementKey (objectToObserve, (notification) => {
Console.WriteLine ($"Observed UnfocusedElementKeyNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
Berlaku untuk
ObserveUnfocusedElementKey(NSObject, EventHandler<NSNotificationEventArgs>)
Pemberitahuan yang diketik dengan kuat untuk P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification .
public static Foundation.NSObject ObserveUnfocusedElementKey (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveUnfocusedElementKey : 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 P:WatchKit.WKInterfaceObject.UnfocusedElementKeyNotification .
// Listen to all notifications posted for any object
var token = WKInterfaceObject.Notifications.ObserveUnfocusedElementKey ((notification) => {
Console.WriteLine ("Observed UnfocusedElementKeyNotification!");
};
// Listen to all notifications posted for a single object
var token = WKInterfaceObject.Notifications.ObserveUnfocusedElementKey (objectToObserve, (notification) => {
Console.WriteLine ($"Observed UnfocusedElementKeyNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();