NameScope.Contains(KeyValuePair<String,Object>) 方法

定義

判斷集合是否包含指定的項目。

public:
 virtual bool Contains(System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^> item);
public bool Contains (System.Collections.Generic.KeyValuePair<string,object> item);
abstract member Contains : System.Collections.Generic.KeyValuePair<string, obj> -> bool
override this.Contains : System.Collections.Generic.KeyValuePair<string, obj> -> bool
Public Function Contains (item As KeyValuePair(Of String, Object)) As Boolean

參數

item
KeyValuePair<String,Object>

要在集合中尋找的項目,指定為 KeyValuePair<TKey,TValue> (索引鍵為 String,值為 Object)。

傳回

如果指定的 KeyValuePair<TKey,TValue> 可識別這個 NameScope 中現有的對應,則為 true。 如果指定的 KeyValuePair<TKey,TValue> 於目前的 NameScope 中不存在,則為 false

實作

例外狀況

keynull

備註

一般而言,您只想要在 XAML 命名範圍中定義名稱,以及它所對應的物件參考值是否為非材料。 在此案例中,您可以改為呼叫 ContainsKey

適用於