DataPackagePropertySet.Description DataPackagePropertySet.Description DataPackagePropertySet.Description DataPackagePropertySet.Description DataPackagePropertySet.Description Property

Definition

Gets or sets text that describes the contents of the DataPackage.

public : Platform::String Description { get; set; }
winrt::hstring Description();

void Description(winrt::hstring description);
public string Description { get; set; }
Public ReadWrite Property Description As string
var string = dataPackagePropertySet.description;
dataPackagePropertySet.description = string;

Property Value

string string string

Text that describes the contents of the DataPackage.

Examples

The following example shows how you can set the description for the content in a DataPackage.

//To see this code in action, add a call to ShareSourceLoad to your constructor or other
//initializing function.
private void ShareSourceLoad()
{
    DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView();
    dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.DataRequested);
}

private void DataRequested(DataTransferManager sender, DataRequestedEventArgs e)
{
    DataRequest request = e.Request;
    request.Data.Properties.Title = "Share Text Example";
    request.Data.Properties.Description = "An example of how to share text.";
    request.Data.SetText("Hello World!");
}
function registerForShare() {
    var dataTransferManager = Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView();
    dataTransferManager.addEventListener("datarequested", shareTextHandler);
}

function shareTextHandler(e) {
    var request = e.request;
    request.data.properties.title = "Share Text Example";
    request.data.properties.description = "A demonstration that shows how to share.";
    request.data.setText("Hello World!");
}

Remarks

We recommend adding a description to a DataPackage object if you can. Target apps can use this description to help users identify what content they're sharing.