ResourceDictionary.Contains(Object) 方法

定义

确定是否 ResourceDictionary 包含带有指定键的元素。Determines whether the ResourceDictionary contains an element with the specified key.

public:
 virtual bool Contains(System::Object ^ key);
public bool Contains (object key);
abstract member Contains : obj -> bool
override this.Contains : obj -> bool
Public Function Contains (key As Object) As Boolean

参数

key
Object

要在 ResourceDictionary 中定位的键。The key to locate in the ResourceDictionary.

返回

如果 ResourceDictionary 包含具有指定键的键/值对,则为 true;否则为 falsetrue if ResourceDictionary contains a key-value pair with the specified key; otherwise, false.

实现

注解

如果请求的项不在此资源字典中,资源查找逻辑也将检查合并的字典。If the requested key is not in this resource dictionary, the resource lookup logic will also check the merged dictionaries.

适用于

另请参阅