Condividi tramite


DataPackagePropertySet.Description Proprietà

Definizione

Ottiene o imposta il testo che descrive il contenuto del 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

Valore della proprietà

String

Platform::String

winrt::hstring

Testo che descrive il contenuto del DataPackage.

Esempio

Nell'esempio seguente viene illustrato come impostare la descrizione per il contenuto in un 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!");
}

Commenti

Se possibile, è consigliabile aggiungere una descrizione a un oggetto DataPackage . Le app di destinazione possono usare questa descrizione per aiutare gli utenti a identificare il contenuto che condividono.

Si applica a