UIView.Notifications.ObserveReduceMotionStatusDidChange 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
ObserveReduceMotionStatusDidChange(EventHandler<NSNotificationEventArgs>) |
Pemberitahuan yang sangat ditik untuk ReduceMotionStatusDidChangeNotification konstanta. |
ObserveReduceMotionStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>) |
Pemberitahuan yang sangat ditik untuk ReduceMotionStatusDidChangeNotification konstanta. |
ObserveReduceMotionStatusDidChange(EventHandler<NSNotificationEventArgs>)
Pemberitahuan yang sangat ditik untuk ReduceMotionStatusDidChangeNotification konstanta.
public static Foundation.NSObject ObserveReduceMotionStatusDidChange (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveReduceMotionStatusDidChange : 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 ReduceMotionStatusDidChangeNotification pemberitahuan.
// Listen to all notifications posted for any object
var token = UIView.Notifications.ObserveReduceMotionStatusDidChange ((notification) => {
Console.WriteLine ("Observed ReduceMotionStatusDidChangeNotification!");
};
// Listen to all notifications posted for a single object
var token = UIView.Notifications.ObserveReduceMotionStatusDidChange (objectToObserve, (notification) => {
Console.WriteLine ($"Observed ReduceMotionStatusDidChangeNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
Berlaku untuk
ObserveReduceMotionStatusDidChange(NSObject, EventHandler<NSNotificationEventArgs>)
Pemberitahuan yang sangat ditik untuk ReduceMotionStatusDidChangeNotification konstanta.
public static Foundation.NSObject ObserveReduceMotionStatusDidChange (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveReduceMotionStatusDidChange : 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 ReduceMotionStatusDidChangeNotification pemberitahuan.
// Listen to all notifications posted for any object
var token = UIView.Notifications.ObserveReduceMotionStatusDidChange ((notification) => {
Console.WriteLine ("Observed ReduceMotionStatusDidChangeNotification!");
};
// Listen to all notifications posted for a single object
var token = UIView.Notifications.ObserveReduceMotionStatusDidChange (objectToObserve, (notification) => {
Console.WriteLine ($"Observed ReduceMotionStatusDidChangeNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();