NameScope.Contains Method (KeyValuePair(Of String, Object))

.NET Framework (current version)

Determines whether the collection contains a specified item.

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

Public Function Contains (
	item As KeyValuePair(Of String, Object)
) As Boolean


Type: System.Collections.Generic.KeyValuePair(Of String, Object)

The item to find in the collection, specified as a KeyValuePair(Of TKey, TValue) (key is String, value is Object).

Return Value

Type: System.Boolean

true if the specified KeyValuePair(Of TKey, TValue) identifies an existing mapping in this NameScope . false if the specified KeyValuePair(Of TKey, TValue) does not exist in the current NameScope.

Exception Condition

key is null.

Generally you are only interested in whether a name is already defined in the XAML namescope, and what object reference value it is mapped to is immaterial. For this scenario, you can call ContainsKey instead.

.NET Framework
Available since 4.0
Return to top