This topic has not yet been rated - Rate this topic

DataProviderRequest.GetDeferral | getDeferral method

Applies to Windows and Windows Phone

Returns a DataProviderDeferral object.

Syntax


var dataProviderDeferral = dataProviderRequest.getDeferral();

Parameters

This method has no parameters.

Return value

Type: DataProviderDeferral

An data provider deferral object.

Remarks

To learn more, check out How to produce requested data asynchronously.

Examples


function onDeferredImageRequested(request) {
    try {
        if (imageFile) {
            // This is to make sure deferral works even in synchronous case
            var deferral = request.getDeferral();
            var imageStreamRef = Windows.Storage.Streams.RandomAccessStreamReference.createFromFile(imageFile);
            request.setData(imageStreamRef);
            deferral.complete();
        }
    } catch (exc) {
        // Error handling goes here.
    }
}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

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

Metadata

Windows.winmd

See also

DataProviderRequest

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.