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


MPMoviePlayerController.DidEnterFullscreenNotification Свойство

Определение

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

[Foundation.Advice("Use MPMoviePlayerController.Notifications.ObserveDidEnterFullscreen helper method instead.")]
[Foundation.Field("MPMoviePlayerDidEnterFullscreenNotification", "MediaPlayer")]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, "Use 'AVPlayerViewController' (AVKit) instead.")]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public static Foundation.NSString DidEnterFullscreenNotification { [ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, "Use 'AVPlayerViewController' (AVKit) instead.")] [ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.DidEnterFullscreenNotification : Foundation.NSString

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

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

Атрибуты

Комментарии

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

Если вы хотите подписаться на это уведомление, можно воспользоваться удобным .MPMoviePlayerController.Notifications Метод M:MPMoviePlayerController.Notifications.ObserveDidEnterFullscreen*, который предоставляет строго типизированный доступ к параметрам уведомления.

В следующем примере показано, как использовать строго типизированный класс Notifications, чтобы вывести догадки из доступных свойств в уведомлении:

//
// Lambda style
//

// listening
notification = MPMoviePlayerController.Notifications.ObserveDidEnterFullscreen ((sender, args) => {
    /* Access strongly typed args */
    Console.WriteLine ("Notification: {0}", args.Notification);
});

// To stop listening:
notification.Dispose ();

//
// Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
    // Access strongly typed args
    Console.WriteLine ("Notification: {0}", args.Notification);
}

void Setup ()
{
    notification = MPMoviePlayerController.Notifications.ObserveDidEnterFullscreen (Callback);
}

void Teardown ()
{
    notification.Dispose ();
}

В следующем примере показано, как использовать уведомление с API DefaultCenter:

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


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

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (MPMoviePlayerController.DidEnterFullscreenNotification, Callback);
}

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