XamlType.LookupKeyType 方法

定義

傳回值,如果 XamlType 表示字典,則這個值提供此 XamlType 之索引鍵屬性的型別資訊。

protected:
 virtual System::Xaml::XamlType ^ LookupKeyType();
protected virtual System.Xaml.XamlType LookupKeyType ();
abstract member LookupKeyType : unit -> System.Xaml.XamlType
override this.LookupKeyType : unit -> System.Xaml.XamlType
Protected Overridable Function LookupKeyType () As XamlType

傳回

XamlType字典使用索引鍵類型的 物件,如果 null 這個 XamlType 不代表字典,則為 。

備註

您可以呼叫 來 KeyType 叫用這個方法。

預設實作可以使用 CLR 反映概念,例如使用 和 ParameterInfo 來檢查 Add 方法 MethodInfo ,以及檢查 BaseType 並嘗試該處的相同邏輯。

如果您想要 KeyType 使用不同的邏輯,請覆寫這個方法。 不會傳回 的 LookupCollectionKind 案例應該傳回 nullXamlCollectionKind.Dictionary

適用於