DataPackage.SetUri(Uri) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
Windows 8.1后,SetUri 可能会更改或不可用。 请改用 ApplicationLink 或 WebLink。
设置 DataPackage 中包含的统一资源标识符 (URI) 。
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)
参数
统一资源标识符 (DATAPackage 中包含的 URI) 。
- 属性
示例
以下代码示例演示了应用如何在 DataPackage 对象上设置 URI。
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);
}
注解
此方法设置 StandardFormats.Uri 的值。
统一资源标识符 (URI) 是 DataPackage 对象直接支持的数据类型之一。 有关其他受支持的数据类型的信息,请参阅 StandardDataFormats 类。