Partilhar via


DataPackage.SetUri(Uri) Método

Definição

Observação

SetUri pode ser alterado ou indisponível para versões após Windows 8.1. Em vez disso, use ApplicationLink ou WebLink.

Define o URI (Uniform Resource Identifier) contido no 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)

Parâmetros

value
Uri Uri

O URI (Uniform Resource Identifier) contido no DataPackage.

Atributos

Exemplos

O exemplo de código a seguir demonstra como um aplicativo pode definir o URI em um objeto 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);
}

Comentários

Esse método define o valor de StandardFormats.Uri.

O URI (Uniform Resource Identifier) é um dos tipos de dados aos quais o objeto DataPackage dá suporte diretamente. Consulte a classe StandardDataFormats para obter informações sobre outros tipos de dados com suporte.

Aplica-se a