NameScope.Add Method (String, Object)

.NET Framework (current version)
 

Adds an item to the collection.

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

public void Add(
	string key,
	object value
)

Parameters

key
Type: System.String

The string key, which is the name of the XAML namescope mapping to add.

value
Type: System.Object

The object value, which is the object reference of the XAML namescope mapping to add.

Exception Condition
ArgumentNullException

key or value is null.

This method basically wraps Add so that it is not necessary to involve the KeyValuePair<TKey, TValue> type in your usage.

Names in a XAML namescope must use a particular grammar that restricts the strings you might use for inputs of NameScope API. See XamlName Grammar.

.NET Framework
Available since 4.0
Return to top
Show: