DataPackage.SetUri(Uri) DataPackage.SetUri(Uri) DataPackage.SetUri(Uri) DataPackage.SetUri(Uri) DataPackage.SetUri(Uri) Method



SetUri may be altered or unavailable for releases after Windows 8.1. Instead, use ApplicationLink or WebLink.

Sets the Uniform Resource Identifier (URI) that is contained in the DataPackage.

public : void SetUri(Uri value)
void SetUri(Uri value) const;
public void SetUri(Uri value)
Public Sub SetUri(value As Uri)


Uri Uri Uri

The Uniform Resource Identifier (URI) that is contained in the DataPackage.


The following code sample demonstrates how an app can set the URI on a DataPackage object.

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("");
function registerForShare() {
    var dataTransferManager = Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView();
    dataTransferManager.addEventListener("datarequested", shareLinkHandler);

function shareLinkHandler(e) {
        var request = e.request; = "Share Link Example"; = "A demonstration that shows how to add a link (URI) to share."; Windows.Foundation.Uri(""));


This method sets the value for StandardFormats.Uri.

Uniform Resource Identifier (URI) is one of the data types that the DataPackage object supports directly. See the StandardDataFormats class for information on other supported data types.