語言

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)。

傳回

true 若指定 KeyValuePair<TKey,TValue> 識別此 NameScope 映射中存在的映射。 false 若 在 KeyValuePair<TKey,TValue> 電流 NameScope中不存在 。

實作

例外狀況

item 是 null。

備註

一般來說,你只需要關心一個名稱是否已經在 XAML 命名範圍中定義,以及它對應到哪個物件參考值並不重要。 在這種情況下,你可以直接打電話 ContainsKey 。

適用於