NameScope.ContainsKey Method (String)

.NET Framework (current version)

Returns whether a provided name already exists in this NameScope.

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

public bool ContainsKey(
	string key


Type: System.String

The string key to find.

Return Value

Type: System.Boolean

true if the specified key identifies a name for an existing mapping in this NameScope. false if the specified key does not exist in the current NameScope.

Exception Condition

key is null.

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