Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Clipboard.GetContent | getContent method

Gets the current content that is stored in the clipboard object.

Syntax


var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.getContent();

Parameters

This method has no parameters.

Return value

Type: DataPackageView

Contains the content of the Clipboard.

Remarks

If the GetContent call is successful, you can use the DataPackageView it returns to get information such as the file types it supports and any properties that the source app assigned through the DataPackagePropertySet class.

Examples


var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.getContent();
if (dataPackageView.contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.text)) {
    dataPackageView.getTextAsync().then(function (text) {
        // To output the text from this example, you need an HTML element
        // with an id of "output".
        document.getElementById("output").innerText = "Clipboard now contains: " + text;
    });
}


Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

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

Metadata

Windows.winmd

See also

Clipboard

 

 

Show:
© 2015 Microsoft