DataPackage.SetUri(Uri) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Note
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:
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)
Parameters
The Uniform Resource Identifier (URI) that is contained in the DataPackage.
- Attributes
Examples
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("http://www.fabrikam.com");
request.Data.SetUri(link);
}
Remarks
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.