TargetedContentCollection.Path 屬性

定義

取得內容集合中專案的路徑。

public:
 property Platform::String ^ Path { Platform::String ^ get(); };
winrt::hstring Path();
public string Path { get; }
var string = targetedContentCollection.path;
Public ReadOnly Property Path As String

屬性值

String

Platform::String

winrt::hstring

Windows 需求

應用程式功能
secondaryAuthenticationFactor

範例

此範例示範如何從已知路徑取得特定物件。 具體而言,集合 1 底下的專案 0 (「\collection1\item1」) ,如資料合約所述。

我們假設 container 是預先存在的訂用帳戶內容容器。

最後,我們會啟動與專案相關聯的 URI。

private async void LaunchObjectUriFromPath(TargetedContentContainer container)
{
    TargetedContentObject contentObject = container.SelectSingleObject("//collection[1]/item[0]");

    await contentObject.Item.Properties["onClick"].Uri.LauchUriAsync();
    }
}

適用於