NameScope.ContainsKey(String) 方法

定义

返回此 NameScope 中是否已存在所提供的名称。Returns whether a provided name already exists in this NameScope.

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

参数

key
String

要查找的字符串键。The string key to find.

返回

Boolean

如果指定的 key 标识此 NameScope 中现有映射的名称,则为 truetrue if the specified key identifies a name for an existing mapping in this NameScope. 如果当前的 key 中不存在指定的 NameScope,则为 falsefalse if the specified key does not exist in the current NameScope.

实现

例外

keynullkey is null.

注解

XAML 名称范围中的名称必须使用特定的语法来限制可用于 NameScope API 的输入的字符串。Names in a XAML namescope must use a particular grammar that restricts the strings you might use for inputs of NameScope API. 请参阅XamlName 语法See XamlName Grammar.

适用于