Поделиться через


WKInterfaceObject.AnnouncementDidFinishNotification Свойство

Определение

Константы уведомлений для AnnouncementDidFinish

[Foundation.Advice("Use WKInterfaceObject.Notifications.ObserveAnnouncementDidFinish helper method instead.")]
[Foundation.Field("UIAccessibilityAnnouncementDidFinishNotification", "WatchKit")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static Foundation.NSString AnnouncementDidFinishNotification { [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.AnnouncementDidFinishNotification : Foundation.NSString

Значение свойства

Константа NSString должна использоваться в качестве токена для NSNotificationCenter.

Атрибуты

Комментарии

Эту константу можно использовать с для NSNotificationCenter регистрации прослушивателя для этого уведомления. Это NSString вместо строки, так как эти значения можно использовать в качестве маркеров в некоторых собственных библиотеках, а не только для их фактического содержимого строк. Параметр notification для обратного вызова содержит дополнительные сведения, относящиеся к типу уведомления.

// Lambda style
NSNotificationCenter.DefaultCenter.AddObserver (
        WKInterfaceObject.AnnouncementDidFinishNotification, (notification) => {Console.WriteLine ("Received the notification WKInterfaceObject", notification); }


// Method style
void Callback (NSNotification notification)
{
    Console.WriteLine ("Received a notification WKInterfaceObject", notification);
}

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (WKInterfaceObject.AnnouncementDidFinishNotification, Callback);
}

Применяется к