ResourceDictionary.Remove(Object) 方法

定义

从基字典中移除带有指定键的项。Removes the entry with the specified key from the base dictionary.

public:
 virtual void Remove(System::Object ^ key);
public void Remove (object key);
abstract member Remove : obj -> unit
override this.Remove : obj -> unit
Public Sub Remove (key As Object)

参数

key
Object

要移除的项的键。Key of the entry to remove.

实现

异常

ResourceDictionary 被锁定或为只读。The ResourceDictionary is locked or read-only.

注解

如果 ResourceDictionary 不包含具有指定键的元素,则 ResourceDictionary 保持不变。If the ResourceDictionary does not contain an element with the specified key, the ResourceDictionary remains unchanged. 不引发异常。No exception is raised.

此方法不删除 MergedDictionaries中的键。This method does not remove keys from the MergedDictionaries. 您必须从集合中获取特定 ResourceDictionary 以删除这些密钥,但这可能是不可能的,因为您通常会远程访问此类字典。You must obtain the specific ResourceDictionary from the collection to remove those keys, but that might not be possible because you are typically accessing such a dictionary remotely.

适用于