Add Method (String, Object)
Collapse the table of content
Expand the table of content

ResourceDictionary.Add Method (String, Object)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Adds an item to the ResourceDictionary.

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

'Declaration
Public Sub Add ( _
	key As String, _
	value As Object _
)

Parameters

key
Type: System.String
The string key of the item to add.
value
Type: System.Object
The item value to add.

ExceptionCondition
NotSupportedException

Attempted to add Nothing as a value.

ArgumentException

Attempted to add an item with a key that already exists in this ResourceDictionary.

All key values provided for a ResourceDictionary must be unique within that ResourceDictionary.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft