Share via


WidgetManager.SendMessageToContent(String, String) Method

Definition

Send a string message to the web content in a widget being displayed in the widgets host.

public:
 virtual void SendMessageToContent(Platform::String ^ widgetId, Platform::String ^ message) = SendMessageToContent;
void SendMessageToContent(winrt::hstring const& widgetId, winrt::hstring const& message);
public void SendMessageToContent(string widgetId, string message);
function sendMessageToContent(widgetId, message)
Public Sub SendMessageToContent (widgetId As String, message As String)

Parameters

widgetId
String

Platform::String

winrt::hstring

The ID of the widget. This is the value provided in the Id property of the WidgetContext object passed into the provider's implementation of IWidgetProvider.CreateWidget.

message
String

Platform::String

winrt::hstring

A string containing the message to be sent to the widget web content.

Implements

M:Microsoft.Windows.Widgets.Providers.IWidgetManager2.SendMessageToContent(System.String,System.String) M:Microsoft.Windows.Widgets.Providers.IWidgetManager2.SendMessageToContent(Platform::String,Platform::String) M:Microsoft.Windows.Widgets.Providers.IWidgetManager2.SendMessageToContent(winrt::hstring,winrt::hstring)

Remarks

The message string can be simple text or the serialized form of an object interpreted by the web content. For more information, see PostWebMessageAsString.

Applies to