Uređivanje

Dijeli putem


NameScope.Remove Method

Definition

Removes the specific object from the collection.

Overloads

Remove(KeyValuePair<String,Object>)

Removes the specific object from the collection.

Remove(String)

Removes a mapping for a specified name from the collection.

Remove(KeyValuePair<String,Object>)

Removes the specific object from the collection.

public:
 virtual bool Remove(System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^> item);
public bool Remove (System.Collections.Generic.KeyValuePair<string,object> item);
abstract member Remove : System.Collections.Generic.KeyValuePair<string, obj> -> bool
override this.Remove : System.Collections.Generic.KeyValuePair<string, obj> -> bool
Public Function Remove (item As KeyValuePair(Of String, Object)) As Boolean

Parameters

item
KeyValuePair<String,Object>

The object to remove from the collection, specified as a KeyValuePair<TKey,TValue> (key is String, value is Object).

Returns

true if item was successfully removed from the collection, otherwise false. Also returns false if the item was not found in the collection.

Implements

Remarks

Because NameScope is a dictionary there is no concept of first occurrence; any given KeyValuePair<TKey,TValue> is guaranteed unique.

Applies to

Remove(String)

Removes a mapping for a specified name from the collection.

public:
 virtual bool Remove(System::String ^ key);
public bool Remove (string key);
abstract member Remove : string -> bool
override this.Remove : string -> bool
Public Function Remove (key As String) As Boolean

Parameters

key
String

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

Returns

true if item was successfully removed from the collection, otherwise false. Also returns false if the item was not found in the collection.

Implements

Remarks

This method basically wraps UnregisterName, returning false in cases that otherwise would have raised exceptions in UnregisterName.

Applies to