StandardDataFormats.Text Propriété

Définition

Propriété en lecture seule qui retourne la valeur de chaîne d’ID de format correspondant au format Texte.

public:
 static property Platform::String ^ Text { Platform::String ^ get(); };
static winrt::hstring Text();
public static string Text { get; }
var string = StandardDataFormats.text;
Public Shared ReadOnly Property Text As String

Valeur de propriété

String

Platform::String

winrt::hstring

Valeur de chaîne d’ID de format correspondant au format Texte.

Exemples

Cet exemple illustre l’utilisation de la propriété Text . Pour utiliser le code de cet exemple, ajoutez un écouteur d’événements à votre application pour gérer l’événement activé . Ensuite, placez ce code dans la fonction appelée par cet écouteur d’événements.

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

S’applique à