BackgroundMediaPlayer.SendMessageToForeground(ValueSet) BackgroundMediaPlayer.SendMessageToForeground(ValueSet) BackgroundMediaPlayer.SendMessageToForeground(ValueSet) BackgroundMediaPlayer.SendMessageToForeground(ValueSet) BackgroundMediaPlayer.SendMessageToForeground(ValueSet) Method

Definition

Sends a message to the foreground task.

Note

Starting with Windows, version 1703, BackgroundMediaPlayer is deprecated and may not be available in future versions of Windows. Use the MediaPlayer class instead. For more information, see Play media in the background.

public : static void SendMessageToForeground(ValueSet value)
static void SendMessageToForeground(ValueSet value) const;
public static void SendMessageToForeground(ValueSet value)
Public Shared Sub SendMessageToForeground(value As ValueSet)
Windows.Media.Playback.BackgroundMediaPlayer.sendMessageToForeground(value);

Parameters

value
ValueSet ValueSet ValueSet

Set of values representing the message.

Remarks

Apps should only call SendMessageToForeground while the foreground app is running. Attempting to call this method while the foreground app is not running will throw an exception. An app is responsible for communicating the foreground app state to the background process. This can be done using app lifecycle events, state values kept in local storage, and messages between processes.

Calls to SendMessageToForeground should always be made within a try block so that the exception thrown can be caught if the system is unable to send the message.