DataPackage.SetUri(Uri) Metodo

Definizione

Nota

SetUri può essere modificato o non disponibile per le versioni dopo Windows 8.1. Usare invece ApplicationLink o WebLink.

Imposta l'URI (Uniform Resource Identifier) contenuto in DataPackage.

public:
 virtual void SetUri(Uri ^ value) = SetUri;
/// [Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
void SetUri(Uri const& value);
/// [Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
void SetUri(Uri const& value);
/// [Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD).Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
void SetUri(Uri const& value);
[Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
public void SetUri(System.Uri value);
[Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public void SetUri(System.Uri value);
[Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD).Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public void SetUri(System.Uri value);
function setUri(value)
Public Sub SetUri (value As Uri)

Parametri

value
Uri Uri

URI (Uniform Resource Identifier) contenuto in DataPackage.

Attributi

Esempio

Nell'esempio di codice seguente viene illustrato come un'app può impostare l'URI in un oggetto DataPackage .

public void ShareSourceLoad()
{
    DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView();
    dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.DataRequested);
}

void DataRequested(DataTransferManager sender, DataRequestedEventArgs e)
{
    DataRequest request = e.Request;
    request.Data.Properties.Title = "Share Link Example";
    request.Data.Properties.Description = "An example of how to share a link.";
    var link = new Uri("http://www.fabrikam.com");
    request.Data.SetUri(link);
}

Commenti

Questo metodo imposta il valore per StandardFormats.Uri.

Uniform Resource Identifier (URI) è uno dei tipi di dati supportati direttamente dall'oggetto DataPackage . Per informazioni su altri tipi di dati supportati, vedere la classe StandardDataFormats .

Si applica a