Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ResourceDictionary.Remove Method (Object)

Removes a specific item from the ResourceDictionary.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

public void Remove(
	Object key


Type: System.Object
The string key of the item to remove.




key is null.


Attempted to use a key that is not a string.

ResourceDictionary supports collection APIs that support two signatures for the type of the key component, one that takes strings and one that takes Object. Most Silverlight scenarios should use strings as the resource key for resources in a ResourceDictionary. The Object as key signatures exist for compatibility and for interface conformance, but internally the dictionary is implemented such that only strings are accepted as keys. See "Keys and Resources" section of Resource Dictionaries.


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

© 2016 Microsoft