5
사용자 정의 컨트롤 (Control
에서 파생 됨)을 만들고 컨트롤의 기본 테마를 정의하려고합니다. 내가 만든 이전의 모든 사용자 지정 컨트롤은,이 assembly
속성DefaultStyleKey 설정에 대한 차이점
static IntegerUpDown()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(IntegerUpDown),
new FrameworkPropertyMetadata(typeof(IntegerUpDown)));
}
을 사용했다 :이 (나는 또한 일부 컨트롤에 나타났습니다한다)이다 할
[assembly: ThemeInfo(ResourceDictionaryLocation.SourceAssembly,
ResourceDictionaryLocation.SourceAssembly)]
다른 방법 -
public IntegerUpDown()
{
DefaultStyleKey = typeof(IntegerUpDown);
}
나는이 두 접근법의 장단점을 알고 싶습니까?