ResourceDictionary.Clear 方法

定义

清除基 ResourceDictionary 中的所有键(以及值)。Clears all keys (and values) in the base ResourceDictionary. 这不会清除任何合并的字典项。This does not clear any merged dictionary items.

public:
 virtual void Clear();
public void Clear ();
abstract member Clear : unit -> unit
override this.Clear : unit -> unit
Public Sub Clear ()

实现

注解

如果需要清除合并字典项,请从 MergedDictionaries 集合获取特定字典,并专门对该 ResourceDictionary调用 Clear,尽管字典通常是远程的,你可能没有访问权限。If you need to clear merged dictionary items, obtain the particular dictionary from MergedDictionaries collection and specifically call Clear on that ResourceDictionary, although typically the dictionaries are remote and you might not have access. 或者,通过对泛型集合调用 Remove,从 MergedDictionaries 中删除整个 ResourceDictionaryAlternatively, remove the entire ResourceDictionary from MergedDictionaries by calling Remove on the generic collection.

适用于