DataPackage.SetUri | setUri method

Applies to Windows and Windows Phone

[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.

Syntax


Public Sub SetUri(
  value As Uri 
)

Parameters

value

Type: Windows.Foundation.Uri [JavaScript] | System.Uri [.NET] | Windows::Foundation::Uri [C++]

The URI that is contained in the DataPackage.

Remarks

This method sets the value for StandardFormats.Uri.

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

Examples

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


function registerForShare() {
    var dataTransferManager = Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView();
    dataTransferManager.addEventListener("datarequested", shareLinkHandler);
}

function shareLinkHandler(e) {
        var request = e.request;
        request.data.properties.title = "Share Link Example";
        request.data.properties.description = "A demonstration that shows how to add a link (URI) to share.";
        request.data.setUri(new Windows.Foundation.Uri("http://www.fabrikam.com"));
}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

End of client support

Windows 8.1

End of server support

Windows Server 2012 R2

Namespace

Windows.ApplicationModel.DataTransfer
Windows::ApplicationModel::DataTransfer [C++]

Metadata

Windows.winmd

See also

DataPackage

 

 

Show:
© 2014 Microsoft