Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 1.45 KB

datarequest_data.md

File metadata and controls

32 lines (20 loc) · 1.45 KB
-api-id -api-type
P:Windows.ApplicationModel.DataTransfer.DataRequest.Data
winrt property

Windows.ApplicationModel.DataTransfer.DataRequest.Data

-description

Sets or gets a DataPackage object that contains the content a user wants to share.

-property-value

Contains the content a user wants to share.

-remarks

The Data property enables your app to supply data to a target app. Your app must supply this data by using a DataPackage object.

Use this property when your app has the content immediately available that the user wants to share. If you need to call a function to generate the DataPackage, use the GetDeferral method.

When your app cannot supply a DataPackage object, use the FailWithDisplayText method to cancel the share and provide a message that the target app can display to the user.

-examples

The following code shows how to get a DataPackage object from the Data property as part of setting the data on a DataPackage to share with another app.

[!code-csharpHowToShareTextBasic]

-see-also