DataPackage.SetData | setData method

This topic has not yet been rated - Rate this topic

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

Syntax


dataPackage.setData(formatId, value);

Parameters

formatId

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

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

value

Type: Object [JavaScript] | System.Object [.NET] | Platform::Object [C++]

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.

Windows Phone 8

This API is not implemented and will throw an exception if called.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.ApplicationModel.DataTransfer
Windows::ApplicationModel::DataTransfer [C++]

Metadata

Windows.winmd

See also

DataPackage

 

 

Build date: 2/25/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.