DataPackage.SetUri | setUri method
Sets the Uniform Resource Identifier (URI) that is contained in the DataPackage.
Syntax
dataPackage.setUri(value);
Parameters
- value
-
Type: 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 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 2/25/2013
