Clipboard.GetContent Clipboard.GetContent Clipboard.GetContent Clipboard.GetContent Clipboard.GetContent Method

Definition

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

public : static DataPackageView GetContent()
static DataPackageView GetContent() const;
public static DataPackageView GetContent()
Public Shared Function GetContent() As DataPackageView
var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.getContent();

Returns

Contains the content of the Clipboard.

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;
    });
}

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.