BackgroundMediaPlayer.MessageReceivedFromForeground 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从前台任务收到消息时发生。
注意
从 Windows 版本 1703 开始,BackgroundMediaPlayer 已弃用,并且在 Windows 的未来版本中可能不可用。 请改用 MediaPlayer 类。 有关详细信息,请参阅 在后台播放媒体。
// Register
static event_token MessageReceivedFromForeground(EventHandler<MediaPlayerDataReceivedEventArgs> const& handler) const;
// Revoke with event_token
static void MessageReceivedFromForeground(event_token const* cookie) const;
// Revoke with event_revoker
static BackgroundMediaPlayer::MessageReceivedFromForeground_revoker MessageReceivedFromForeground(auto_revoke_t, EventHandler<MediaPlayerDataReceivedEventArgs> const& handler) const;
/// [add: Windows.Foundation.Metadata.Deprecated("Use MediaPlayer instead of BackgroundMediaPlayer. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
/// [remove: Windows.Foundation.Metadata.Deprecated("Use MediaPlayer instead of BackgroundMediaPlayer. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
// Register
static event_token MessageReceivedFromForeground(EventHandler<MediaPlayerDataReceivedEventArgs> const& handler) const;
// Revoke with event_token
static void MessageReceivedFromForeground(event_token const* cookie) const;
// Revoke with event_revoker
static BackgroundMediaPlayer::MessageReceivedFromForeground_revoker MessageReceivedFromForeground(auto_revoke_t, EventHandler<MediaPlayerDataReceivedEventArgs> const& handler) const;
public static event System.EventHandler<MediaPlayerDataReceivedEventArgs> MessageReceivedFromForeground;
[add: Windows.Foundation.Metadata.Deprecated("Use MediaPlayer instead of BackgroundMediaPlayer. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
[remove: Windows.Foundation.Metadata.Deprecated("Use MediaPlayer instead of BackgroundMediaPlayer. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
public static event System.EventHandler<MediaPlayerDataReceivedEventArgs> MessageReceivedFromForeground;
function onMessageReceivedFromForeground(eventArgs) { /* Your code */ }
Windows.Media.Playback.BackgroundMediaPlayer.addEventListener("messagereceivedfromforeground", onMessageReceivedFromForeground);
Windows.Media.Playback.BackgroundMediaPlayer.removeEventListener("messagereceivedfromforeground", onMessageReceivedFromForeground);
- or -
Windows.Media.Playback.BackgroundMediaPlayer.onmessagereceivedfromforeground = onMessageReceivedFromForeground;
Public Shared Custom Event MessageReceivedFromForeground As EventHandler(Of MediaPlayerDataReceivedEventArgs)
事件类型
- 属性