DataPackage.SetData(String, Object) DataPackage.SetData(String, Object) DataPackage.SetData(String, Object) DataPackage.SetData(String, Object) DataPackage.SetData(String, Object) Method

Definition

Sets the data contained in the DataPackage in a RandomAccessStream format.

public : void SetData(Platform::String formatId, Platform::Object value)
void SetData(winrt::hstring formatId, winrt::Windows::Foundation::IInspectable value) const;
public void SetData(String formatId, Object value)
Public Sub SetData(formatId As String, value As Object)
dataPackage.setData(formatId, value);

Parameters

formatId
String String String

Specifies the format of the data. We recommend that you set this value by using the StandardDataFormats class.

value
Object Object Object

Specifies the content that the DataPackage contains.

Remarks

To add data using this method, your app must convert the data into an object. You must also specify a formatId that target apps can use to request the data. Note that the target app can request this data only if it knows the formatId.

This method is often used when you use a delegate function to share data. For more information, see How to support pull operations.