Item Property

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.

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

'Declaration
Public Property Item ( _
	key As Object _
) As Object

Parameters

key
Type: System.Object
The key of the element to get.

Property Value

Type: System.Object
The object if it exists; otherwise, Nothing.

Implements

IDictionary.Item(Object)

ExceptionCondition
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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft