ResourceDictionary.Item Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets the element at the specified index.
Assembly: System.Windows (in System.Windows.dll)
| Exception | Condition |
|---|---|
| NotImplementedException | Attempted to set a value using the indexer. |
| ArgumentNullException | key is Nothing. |
| ArgumentException | key is not a string. |
The main scenario for using the ResourceDictionary is to retrieve resources from a specific ResourceDictionary at run time.
This indexer implementation specifically blocks a "set" usage. If you attempt to set a value using the indexer, an exception is thrown. You must remove and re-add to the ResourceDictionary in order to change a key-value pair.