语言

NameScope.Remove 方法

定义

从集合中删除特定对象。

重载

名称 说明
Remove(KeyValuePair<String,Object>)

从集合中删除特定对象。

Remove(String)

从集合中删除指定名称的映射。

Remove(KeyValuePair<String,Object>)

从集合中删除特定对象。

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

参数

item
KeyValuePair<String,Object>

要从集合中移除的对象,指定为 KeyValuePair<TKey,TValue> (键为StringObject,值为 )。

返回

true 如果项已成功从集合中删除,则为 ;否则为 false。 如果集合中找不到该项,则还返回 false 。

实现

注解

因为 NameScope 字典没有第一次出现的概念;任何给定 KeyValuePair<TKey,TValue> 都保证是唯一的。

适用于

Remove(String)

从集合中删除指定名称的映射。

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

参数

key
String

字符串键,它是要删除的 XAML 名称范围映射的名称。

返回

true 如果项已成功从集合中删除,则为 ;否则为 false。 如果集合中找不到该项,则还返回 false 。

实现

注解

此方法基本上包装UnregisterName,在本来会引发异常false的情况下返回UnregisterName。

适用于