Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 1.58 KB

datarequest_getdeferral_254836512.md

File metadata and controls

30 lines (19 loc) · 1.58 KB
-api-id -api-type
M:Windows.ApplicationModel.DataTransfer.DataRequest.GetDeferral
winrt method

Windows.ApplicationModel.DataTransfer.DataRequest.GetDeferral

-description

Supports asynchronous sharing operations by creating and returning a DataRequestDeferral object.

-returns

An object that allows you to share or send content asynchronously.

-remarks

The GetDeferral method allows your app to call a function during a share operation, so that your app can asynchronously generate the DataPackage object for the target app.

Use this method when you want to use an asynchronous function call to generate the DataPackage during a share operation. This function must return a DataPackage object within 200ms to prevent the operation from timing out. If your app shares content that takes more time to package, such as a collection of files or photos, don't use this method. Instead, use the SetDataProvider method to assign a delegate to a DataPackage and return that DataPackage to the target app.

-examples

The following sample shows how to get a DataRequestDeferral object by using the GetDeferral method.

[!code-csharpHowToShareImage]

-see-also