ReportCompleted() | reportCompleted() method
Collapse the table of content
Expand the table of content

ShareOperation.ReportCompleted() | reportCompleted() method

Specifies that the sharing operation is complete.

Syntax


Public Sub ReportCompleted()

Parameters

This method has no parameters.

Remarks

When your app acts as a target for a share operation, it should call reportComplete after it has processed the data being shared. This method closes the app window and returns the user to the source app.

Examples

The following example shows how a target app might respond to a share operation. Notice the use of reportComplete when the target app has finished processing the data.


if (eventArgs.kind === Windows.ApplicationModel.Activation.ActivationKind.shareTarget) {
    shareOperation = eventArgs.shareOperation;
    if (shareOperation.data.contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.text)) {
        var output = document.createElement("div");
        var shareData = shareOperation.data.getText();
        output.innerText = shareData;
        document.body.appendChild(output);
        shareOperation.reportCompleted();
    }
}


Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0 [for Xbox, see UWP features that aren't yet supported on Xbox]

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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.ShareTarget
Windows::ApplicationModel::DataTransfer::ShareTarget [C++]

Metadata

Windows.winmd

See also

ShareOperation
ReportCompleted(QuickLink)

 

 

Show:
© 2016 Microsoft