NameScope::Contains Method

Determines whether the collection contains a specified item.

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

public:
virtual bool Contains(
	KeyValuePair<String^, Object^> item
) sealed

Parameters

item
Type: System.Collections.Generic::KeyValuePair<String, Object>

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

Return Value

Type: System::Boolean
true if the specified KeyValuePair<TKey, TValue> identifies an existing mapping in this NameScope . false if the specified KeyValuePair<TKey, TValue> does not exist in the current NameScope.

Implements

ICollection<T>::Contains(T)

ExceptionCondition
ArgumentException

key is nullptr.

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

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft