Compartilhar via


UIView.Notifications.ObserveFocusedElementKey Método

Definição

Sobrecargas

ObserveFocusedElementKey(EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a constante P:UIKit.UIView.FocusedElementKeyNotification .

ObserveFocusedElementKey(NSObject, EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a constante P:UIKit.UIView.FocusedElementKeyNotification .

ObserveFocusedElementKey(EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a constante P:UIKit.UIView.FocusedElementKeyNotification .

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

Parâmetros

handler
EventHandler<NSNotificationEventArgs>

Método a ser invocado quando a notificação é postada.

Retornos

Objeto de token que pode ser usado para parar de receber notificações descartando-o ou passando-o para RemoveObservers(IEnumerable<NSObject>)

Comentários

Esse método pode ser usado para assinar notificações P:UIKit.UIView.FocusedElementKeyNotification .

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

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

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

Aplica-se a

ObserveFocusedElementKey(NSObject, EventHandler<NSNotificationEventArgs>)

Notificação fortemente tipada para a constante P:UIKit.UIView.FocusedElementKeyNotification .

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

Parâmetros

objectToObserve
NSObject

O objeto a ser observado.

handler
EventHandler<NSNotificationEventArgs>

Método a ser invocado quando a notificação é postada.

Retornos

Objeto de token que pode ser usado para parar de receber notificações descartando-o ou passando-o para RemoveObservers(IEnumerable<NSObject>)

Comentários

Esse método pode ser usado para assinar notificações P:UIKit.UIView.FocusedElementKeyNotification .

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

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

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

Aplica-se a