Share via


IKeyIndexMapping.IndexFromKey(String) 方法

定義

擷取具有指定唯一識別碼的專案索引 (索引鍵) 。

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

public:
 int IndexFromKey(Platform::String ^ key);
int IndexFromKey(winrt::hstring const& key);
public int IndexFromKey(string key);
Public Function IndexFromKey (key As String) As Integer

參數

key
String

Platform::String

winrt::hstring

要尋找索引的專案唯一識別碼 (索引鍵) 。

傳回

Int32

int

具有指定索引 的專案索引。

適用於