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.

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


Type: System.String

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

Type: System.Object

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

Exception Condition

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
© 2017 Microsoft