StandardDataFormats.Uri 属性

定义

注意

Windows 8.1后,URI 可能会更改或不可用于发布。 请改用 ApplicationLinkWebLink

一个只读属性,返回与统一资源标识符 (URI) 格式对应的格式 ID 字符串值。

public:
 static property Platform::String ^ Uri { Platform::String ^ get(); };
/// [get: Windows.Foundation.Metadata.Deprecated("Uri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use WebLink or ApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
static winrt::hstring Uri();
/// [get: Windows.Foundation.Metadata.Deprecated("Uri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use WebLink or ApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
static winrt::hstring Uri();
public static string Uri { [Windows.Foundation.Metadata.Deprecated("Uri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use WebLink or ApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] get; }
public static string Uri { [Windows.Foundation.Metadata.Deprecated("Uri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use WebLink or ApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] get; }
var string = StandardDataFormats.uri;
Public Shared ReadOnly Property Uri As String

属性值

String

Platform::String

winrt::hstring

与统一资源标识符 (URI) 格式对应的格式 ID 字符串值。

属性

示例

此示例演示如何使用 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);
}

适用于