ResourceDictionary.RegisterName(String, Object) 方法

定义

此字典实现不支持该方法。Not supported by this Dictionary implementation.

public:
 virtual void RegisterName(System::String ^ name, System::Object ^ scopedElement);
public void RegisterName (string name, object scopedElement);
abstract member RegisterName : string * obj -> unit
override this.RegisterName : string * obj -> unit
Public Sub RegisterName (name As String, scopedElement As Object)

参数

name
String

不支持。Not supported.

scopedElement
Object

不支持。Not supported.

实现

异常

在调用此方法的所有情况下引发。In all cases when this method is called.

注解

ResourceDictionary 类不支持按名称注册。The ResourceDictionary class does not support registering by name. 它使用密钥。It uses keys instead. XAML 命名范围方法在 ResourceDictionary 中实现为无效版本,以清楚地表明 XAML 名称不适用于资源。The XAML namescope methods are implemented as inoperative versions in ResourceDictionary to make it clear that XAML names do not apply to resources.

调用此方法将导致引发 NotSupportedExceptionCalling this method will cause a NotSupportedException to be thrown.

适用于