DataPackagePropertySet.Description Property

Definition

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

public:
 property Platform::String ^ Description { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring Description();

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

Property Value

String

Platform::String

winrt::hstring

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

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.

Applies to