ComponentResourceKey 생성자

정의

ComponentResourceKey 클래스의 새 인스턴스를 초기화합니다.

오버로드

ComponentResourceKey()

ComponentResourceKey 클래스의 새 인스턴스를 초기화합니다.

ComponentResourceKey(Type, Object)

키를 정의하는 개체와 추가 리소스 식별자로 사용할 개체를 지정하여 Type 클래스의 ComponentResourceKey 새 인스턴스를 초기화합니다.

ComponentResourceKey()

ComponentResourceKey 클래스의 새 인스턴스를 초기화합니다.

public:
 ComponentResourceKey();
public ComponentResourceKey ();
Public Sub New ()

설명

적절한 초기화를 위해서는 값과 ResourceId 값이 필요하기 때문에 TypeInTargetAssembly 매개 변수가 없는 생성자는 일반적으로 사용되지 않습니다. 매개 변수가 없는 생성자는 주로 명명된 매개 변수 형식의 ComponentResourceKey 태그 확장 XAML 사용을 지원하기 위해 존재합니다.

적용 대상

ComponentResourceKey(Type, Object)

키를 정의하는 개체와 추가 리소스 식별자로 사용할 개체를 지정하여 Type 클래스의 ComponentResourceKey 새 인스턴스를 초기화합니다.

public:
 ComponentResourceKey(Type ^ typeInTargetAssembly, System::Object ^ resourceId);
public ComponentResourceKey (Type typeInTargetAssembly, object resourceId);
new System.Windows.ComponentResourceKey : Type * obj -> System.Windows.ComponentResourceKey
Public Sub New (typeInTargetAssembly As Type, resourceId As Object)

매개 변수

typeInTargetAssembly
Type

리소스 키를 정의하는 형식입니다.

resourceId
Object

typeInTargetAssembly 형식과 연관된 다른 키와 이 ComponentResourceKey를 구분하기 위한 고유 식별자입니다.

예제

다음 예제에서는 ComponentResourceKey 스타일 사용자 지정 항목 지점을 제공 하기 위해 컨트롤 클래스의 정적 키로 노출 되는 합니다.

public static ComponentResourceKey ViewBoxStyleKey =
    new ComponentResourceKey(typeof(MyAssemblyResources), "part_ViewBox");
Public Shared ViewBoxStyleKey As New ComponentResourceKey(GetType(MyAssemblyResources), "part_ViewBox")

설명

이 생성자는 가장 중요 한 첫 번째 시나리오를 사용 하 여 두 가지 시나리오에 대 한 존재 합니다.

  • 만들 수 있도록 지원 한 ComponentResourceKey 사용자 지정 컨트롤 클래스에 공용 정적 필드로 노출 되는 합니다. 이 통해 템플릿에서 자체 정의 된 리소스에 대 한 컨트롤의 액세스를 간소화 {x:Static} 템플릿 속성 값에 대 한 사용 합니다.

  • 지원 ComponentResourceKey 태그 확장 구성 요소 리소스를 참조 하는 제 3 자에 사용할 수 있는 방법 중 하나는 위치 매개 변수 형태로 XAML 사용 합니다.

적용 대상